Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I am using "json_data" plugin with ajax loading.

My current problem is that when i single click to "+" sign, it makes ajax request and load sub-tree but does not display it. I have to click it one more time to expand it.

If i look at demo page, it does expand tree on single click with ajax loading. I am using jstree-v.pre1.0 and jquery 1.6.2 here is my code :

jQuery("#demo").jstree({
            // List of active plugins
            "plugins" : [
                    "themes","json_data","ui","cookies"
            ],
            "json_data" : {
                "data" : t,
                "ajax":{
                    "url" : wgScript + "?title=Special:GetChildren",
                    "data": function(n) {
                    return { id: n.attr ? n.attr("id") : 0 };
                }
            }

            },
            "core" : {
                  },
            "themes" : {
                    "theme" : "classic",
                    "dots" : true,
                    "icons" : true
            },
            "cookies" :
            {
                    "auto_save" : true
            }

           });  

Does anyone know how to fix this ? Thanks

UPDATE : jquery version turned out to be the culprit. opening of tree uses "addBack" function which is available only >= 1.8 version of jquery. I updated my jquery to 1.9.1 and it fixed the issue.

share|improve this question

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.