Treetable - create a dynamic treetable with ajax call

Hi,

I wan’t to create a treetable view, with call the backend system, my problem is that i can’t make it work that it calls the backend on + click

Sample with hardcoded data, i want to load this data from backendside

http://webix.com/snippet/7c45118c

I added the following to get dynamic data to load into my tree:

$$("mytree").attachEvent("onDataRequest", function (id, callback, url) { 

    this.parse( webix.ajax().get("http://your_url_here/").then(function (data) { 
        return data.xml(); 
    }) ); 
    return false; 
});

webix.ui({
    container  : "box",
    view       : "treetable",
    id: "mytree",
    [...]

Did you get anything related to how to load data in treetable through ajax?

@Sayali what’re the exact requirements?

Essential patterns of data loading are described here.

The built-inload() method obtains data with a separate ajax request. If you want to do it manually, basic syntax is:

webix.ajax("/url", function(text, data){
    $$("table").parse(data.json());
})