Topic: add css style for node type

Hello moro! How can I add custom css style to node type? I saw this

types: {
            folder:{
                openIcon: 'mif-tree-open-icon',
                closeIcon: 'mif-tree-close-icon'
            }
        },

in your examples, and is it possible to add something like this 

 name: 'mif-tree-nodeName'

to change node font according to its type?

Re: add css style for node type

types: {
            folder:{
                openIcon: 'mif-tree-open-icon',
                closeIcon: 'mif-tree-close-icon',
                cls: 'my-node-class'
            }
        },

Re: add css style for node type

I found how to do it. It looks like this

types: {
            folder:{
                cls: 'mif-tree-node-stype'
            }
        },

Sorry, for writing here before trying to find resolution by myself.

Re: add css style for node type

moro wrote:
types: {
            folder:{
                openIcon: 'mif-tree-open-icon',
                closeIcon: 'mif-tree-close-icon',
                cls: 'my-node-class'
            }
        },

Thank you very much. And sorry for bothering you

Re: add css style for node type

I met another problem, after I changed node type (at first deleted old one, and then added another), it didn't change its appearance(and it don't have to). I thought Mif.Tree.Draw.update(node) will help me, but it didn't. Here is the code:

function disablePath(node){
    var parent = node.getParent();
    if(parent){
        parent.removeType('folder');
        parent.addType('parent');
        disablePath(parent);
        Mif.Tree.Draw.update(parent);
    }
}

Could you please help me to show changed style?

Re: add css style for node type

it's bug, Mif.Tree.Draw.update don't update node.cls info, fixed rev 28.

function disablePath(node){
    var parent = node.getParent();
    if(parent){
        parent.removeType('folder');
        parent.addType('parent');
        disablePath(parent);
    }
}

should work with latest rev.

Re: add css style for node type

It works! Thank you for your support!