Filemanager dispatches UI update to wrong branch

In some yet to be understood case, there appears to be a closest string match on folder names that contain a substring of the matching branch.

In this case, the UI should update the branch named “test2test” but, after the proxy returns, the implementation updates the branch named “test2”.

Here’s the example: http://webix.com/snippet/54e40065

As far as I can see, the problem occurs due to non-unique item ids (Child1, Child2) that are already present in the initial dataset.

For testing you can make ids of the items being parsed within proxy unique by adding the webix.uid() autogenerated id to them.

Also (it’s not connected with this topic) I would recommend you to call the default callback that is passed into the proxy if you need to avoid parsing the same data into the branch.

You can check it in the snuippet: http://webix.com/snippet/99894ae2

Helga, thanks again.

yes, the name conflict was the problem.

Surprisingly, when I call the proxies default call, I get a runtime exception.

The message reads:

Data loading error, check console for details. 

The console points to “webix_debug.js:3507 Data loading error”

I’ll look into this more later but, thank you for resolving the issue with the conflicting entry values.

Helga,

This problem leads me to wonder what will happen if I have a name conflict when attempting to add a branch where the parent name is ambiguous.

Is the framework aware of the context of the parent? Should I use the same trick to make all of the id’s unique?

example:

{"parent":"test2test"+uid,"data":[...

Sure, you can add a branch with the same name, but IDs must be unique to avoid ambiguity.

You can perform searches either on the client or server side to check for the inuque ids.

For example, on the client side all data items available within the File Manager are stored in the $$("files").data.pull; hash.

FYI,

in the end I decided to create unique ID’s by base64 encoding the full filename and path.

Given no 2 files will have the exact same pathname+filename combination, this solution is fairly robust against collision. Encoding this information in the ID field also allows the client to resolve any information related to the parent without a server side lookup.