Filemanager Dynamic Branches and Refresh

Hi Webix team,

Here’s one more question for you.

I have lots of cool functionality working but, when I navigate to a directory that requires a load from my server, the results are not shown immediately. I have to leave the directory and re-enter it to see the results.

Here’s a snippet from my proxy:

$$("files").parse( webix.ajax().headers({ "Custom-Header":
    'version=1&action=dir&format=xml'}).get(localURL).then(function (data) {
var entry = new Object ();
entry.parent = parentDir.id;
entry.data = formatPath (data.xml (), true);
return entry; 
})

Here’s a video screen capture of the problem:

As you can see, the state of the directory changes when the content loads, evidenced by the presence of the expansion arrow on select but, the data loaded to that path doesn’t appear until I re-enter the directory a second time.

Seems like a simple oversight somewhere just not sure what to look for yet.

Thanks in advance.

Hello,

You can call the parseData method to parse the needed records and refresh the active folder at once:

webix.ajax().get(url).then(function (data) {
    ...
    //parse and refresh active folder  
    $$("files").parseData(entry);   
});

http://webix.com/snippet/ae56736b

Perfect, Helga!

Thank you for your support, I now have a fully functional Filemanager.