Hi I’d like to prevent the dbl-click event to download files, but still allow the regular click and select an item. Is that possible?
Also is there a way to capture click or dbl-click on items so that we can disable selection?
something like this for grid?
https://snippet.webix.com/2a428a8b
Hey @Miguel, you can prevent the download performed via default user action (double click) with the help of onBeforeRun
event.
Here is an example: https://snippet.webix.com/qacwxosf.
By simply returning false
you will prevent the download, but now your only way to trigger download is via API, by calling the download
method, which doesn’t trigger the onBeforeRun
event.
thanks @Dzmitry worked perfectly
To disable the selection if its a folder, had to go through a bit of work:
this.ui = window.webix.ui({
on: {
onItemClick: (id, event) => {
const eventPath = event.path.map(el => el.className);
// verify if I clicked within files, an not on the tree folder:
if (!eventPath.includes('webix_fmanager_file')){ return; }
const clickedItem = this.ui.getItem(id);
// verify if its a folder:
if (clickedItem.type === 'folder'){
return false;
}
}
}
}
Is there a cleaner approach?