would like to add extra metadata on folders and change icons

I would like to add extra metadata on folders and change the folder icon depending on those metadata. is it possible? if yes how to achieve it.

Hello @ekanimba ,

The implementation could look something like this:
https://snippet.webix.com/apinbgtq

In the example above, we use getMeta when calling files/folders to pull up the metadata and throw it directly into the data (here we are throwing local data for the example). In your case, the getMeta() method does not need to be changed, because it will all be taken from your server by a link like:

GET http://localhost:3200/meta?id=%2folder_name`

And then you may need to change the related data templates (in the side tree, and in the Table/Cards modes), check the metadata and then set the necessary icons on their basis:

  1. Template for the side tree:
    The default template of Tree in Webix consists of several predefined parts that can be customized separately (i.e. you can define the representation of file/folder icons, expand/collapse icons, and the text itself).The needed method is folders().

  2. Main modes of application (Table, Cards, Total) use a datatable and a dataview with complex templates for data representation. The icons for them were included directly to the main template function (as these components have no predefined templates for hierarchical data). The most complex template is made for Cards view (as it contains several icons and labels depending on the item’s type).

To sum up, the main thing is that the server provides metadata for such customization (on request http://localhost:3200/meta?..)

Also please check the next articles: