mercredi 25 novembre 2015

jstree incompatible checkbox and types plugin

I'm creating a tree using the jstree javascript library while using two jstree plugins:

  • checkbox plugin

  • types plugin

Here is a code example with

var mydata=[
id: "1",
parent: "#",
text: "node1",
},
{
id: "2",
parent: "#",
text: "node2",
type: "nodeattribute",
}];

        $('#dqResultsJSTree').jstree(
                {
                    'core' : {
                        'themes' : {
                            'variant' : 'large',
                            'icons' : false,
                        },
                        'data' : mydata,
                    },
                    'types' : {
                            'nodeattribute' : {
                              'icon' : 'http://ift.tt/1XeFM5A',
                            },
                     },
                    'checkbox' : {
                        cascade : "",
                        three_state : false,
                    },
                    'plugins' : [ 'checkbox', 'types'],
                });

The problem I'm having is that the type is not working. The node with id=2 does not show the icon defined at type nodeattribute. Does anybody have had this problem using while using the checkbox at the same time?

Thanks in advance.

Source: http://ift.tt/1Ig34vR




Aucun commentaire:

Enregistrer un commentaire