|
Index.js
var fileObject = new ej.filemanager.FileManager({
ajaxSettings: {
},
toolbarSettings:{items: ['Custom']},
toolbarClick:toolbarClick,
fileSelect:fileSelection
});
// event for custom toolbar item
function toolbarClick(args) {
if (args.item.text === 'Custom') {
alert('You have clicked custom toolbar item')
}
}
function fileSelection(args){
if(fileObject.getSelectedFiles().length!=1){
//to hide the custom toolbar when more than one files are selected
document.getElementById(this.element.id+'_tb_custom').style.display="none";
}
else{
//to show the custom toolbar when only one file is selected
document.getElementById(this.element.id+'_tb_custom').style.display="block";
}
} -------------------------------------------------------------- Index.html
<style>
.e-filemanager #filemanager_tb_custom {
display: none; //to hide the custom toolbar at initial rendering.
}
</style>
|