Svedr
Svedr

Reputation: 589

Initializing Fancytree with AJAX

I've been trying for hours and can't get it to work. I am trying to initialize Fancytree with ajax. This is what I've got so far.

$(function(){
    $("#tree").fancytree({
               initAjax: {url: "/ajaxData.do",
               data: "action=buyclassification",
               }
        });
    });

It looks simple but I can't figure out what I am doing wrong.

Upvotes: 2

Views: 1067

Answers (1)

Daniel Waghorn
Daniel Waghorn

Reputation: 2985

Looking at the docs the data parameter should be in JSON. Try:

$(function(){
$("#tree").fancytree({
           initAjax:{ 
               url: "/ajaxData.do",
               data: {action: "buyclassification"}
           }
    });
});

Upvotes: 3

Related Questions