Create new folder - how can I set id for it that Webix recognize it

I’m using filemanager , loading data dynamically via “files” mode. Our files are saved in db without folders.
Example of file - “/folder1/folder2/file.jpg”. Folders doesn’t exist at all , we are simulating them.
What problem is , when i create new folder on filemanager , there is nothing to be saved in db. Only if something is uploaded on it.

That folder persist only on webix with ID like “1575648487902”. How can I update folder ID so it follows my file structure. For example , for folder ‘folder3’ inisde "folder1/folder2/’ - i want it have id - “folder1/folder2/folder3”. I managed to update it using

https://docs.webix.com/api__link__ui.datatable_updateitem.html

but after that , folder isn’t clickable and I’ve got errors in console.

Hello @mtasic,

How can I update folder ID so it follows my file structure.

Generally, the updates of this kind should be handled on the server-side. When some action is executed (creating a folder, deleting a folder, etc.) with files/folders, File Manager sends a POST Ajax request to the corresponding server-side script specified in the handlers property of FileManager configuration. As mentioned already, creating a folder as an action also has its own handler:

  webix.ui({
    view:"filemanager",
    handlers:{
      "create": path
      // OR
      "create": function() {
       //custom load() function
       }
      // OR
       "create": {
        $proxy: true,
         load: function() {
       // handle the outcoming server request and the response 
       // provide custom methods within the proxy
         }
       }
    }
  });

You can use any of these methods to handle the “create” operation, it all depends on your specific needs. In your case you can simply specify a path to the server script and let it return the appropriate response You can see the correct server response formats in our article regarding file manager data handling. In short, the response should look like the following:

{
    "id":"newId",
    "value":"newFolder"
}

The target folder will be assigned a new id and renamed accordingly (if needed).