Hi,
When dynamically loading treetable branch,
I need to pass a dynamically generated url based on the id to the loadbranch url :
on: { onBeforeOpen: function (id) { // if children have not been loaded yet if (this.getItem(id).$count === -1) { custom_url = '/foo/'+id+'/bars'; this.loadBranch(id, null, custom_url); } } }
But this don’t work because the url is cached in the loadBranch method and in next onBeforeOpen call, the loadbranch will not use the new url given, but use the cached one (the first one)
This is clearly visible in loadBranch code :
loadBranch:function(id, callback, url){ id = id ||0; this.data.url = this.data.url || url; if (this.callEvent("onDataRequest", [id,callback,this.data.url]) && this.data.url) this.data.feed.call(this, id, 0, callback); },
We can see that this.data.url = this.data.url || url;
make cached url prevail on the given url.
My opinion is that the given url should prevail on the cached url.
Thanks
PS : The workaround is to use the “onDataRequest” way :
http://docs.webix.com/datatree__dynamic_loading.html#redefiningondatarequestevent