jQuery UI Widgets Forums Navigation Tree expandItem sometimes not working immediately after addTo

This topic contains 1 reply, has 2 voices, and was last updated by  svetoslav_borislavov 6 months, 2 weeks ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author

  • Gary

    I’m encountering an issue with expandItem toggling the arrow of the branch, but leaving the child nodes hidden.


    I can work around this by putting a delay on the expandItem using a timer, but it should probably be addressed at some point.

           height: '300px',
           width: '300px',
           theme: 'energyblue' 
       $('#jqxTree').jqxTree('addTo', {id:'preTop', label:"Pre-Top"});
       $('#jqxTree').jqxTree('addTo', {id:'treeTop', label:"Top"});
       let treeTop = document.getElementById('treeTop');
       $('#jqxTree').jqxTree('addTo', {id:'branchA', label:"A"}, treeTop);
       $('#jqxTree').jqxTree('addTo', {id:'branchB', label:"B"}, treeTop);
       $('#jqxTree').jqxTree('expandItem', treeTop); // This expandItem typically fails to show children.
       let expandTimer = null;
       expandTimer = setTimeout(function() {
       	 $('#jqxTree').jqxTree('expandItem', treeTop); // This expandItem always shows the children.
       $('#jqxTree').jqxTree('addTo', {id:'postTop', label:"Post-Top"});


    This is happening because addTo is an async method and you should await the addition.
    Here is an example of doing it: http://jsfiddle.net/tjau5gbo/1/

    Best regards,
    Svetoslav Borislavov

    jQWidgets Team

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.