2

I have to mark some nodes as partially selected, so I set "partsel" property "true", but it doesn't work, when tree finally build this node property has "false". But when nodes are expanding it can work properly.

I think that the reason of this behavior is caused by final tree initialization , because there no selected children of partially selected node.

Is it so? If my suggestion is right, how can I resolve it?

 $('#checkbox-tree').fancytree({
      extensions: ["filter"],
      quicksearch: true,
      checkbox: true,
      selectMode: 3,
      filter: {
                autoApply: true,
                // autoExpand: true,
                mode: "hide"
            },
      source: $.ajax({
        url: "/",
        dataType: "json"
      }),
      createNode: function(event, data) {
        var node = data.node;
        num = parseInt( node.key );

        if ( node.key == 1 ) {
          node.partsel = true;
          node.setActive();
        }
      },
      select: function(event, data){

      },
      activate: function(event, data){
        if ( data.node.key == 1 ) {
          // here data.node.partsel == 'true';

        }
      }
 });
Pete
  • 57,112
  • 28
  • 117
  • 166
superdimon
  • 66
  • 7

0 Answers0