Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
145078 | Jun 5,2019 01:49 PM UTC | Jun 6,2019 11:44 AM UTC | Angular - EJ 2 | 1 |
![]() |
Tags: FileManager |
// File Manager’s created event function
onCreated(args) {
var i = 0;
// Get all the toolbar items span element which contains the text
var toolbarItems = this.fileManagerInstance.toolbarModule.toolbarObj.element.querySelectorAll('.e-tbar-btn-text');
while (i < toolbarItems.length) {
// If it is the custom toolbar item, then store its item element in private variable
this.customToolElement = (toolbarItems[i].innerHTML === "Custom") ? toolbarItems[i].closest('.e-toolbar-item') : ''
i++;
}
// Add e-hidden class to the custom toolbar item’s element
this.customToolElement.classList.add('e-hidden');
} |
// File Manager’s fileSelect event function
onFileSelect(args) {
if (args.action as any === "select") {
// Checks if selected item is folder and contains e-hidden class
if (!args.fileDetails.isFile && this.customToolElement.classList.contains('e-hidden'))
// Remove the class from custom toolbar item
this.customToolElement.classList.remove('e-hidden');
// Checks if selected item is file and does not contain e-hidden class
else if (args.fileDetails.isFile && !this.customToolElement.classList.contains('e-hidden'))
// Add the class to custom toolbar item
this.customToolElement.classList.add('e-hidden');
}
// Add class to custom toolbar item on unselect action when selected items is 0
else if (args.action as any === "unselect" && this.fileManagerInstance.selectedItems.length === 0)
}
} |
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.