Hi Team,
We need to customize the view dropdown(large icons/details) of file-manager in our application. Instead of dropdown, we need 2 buttons side-by-side for icons and details.
Is it possible?
|
[app.component.html]
<ejs-filemanager id='overview' #fileManager [ajaxSettings]='ajaxSettings' [view]='view'
[toolbarSettings]='toolbarSettings' (toolbarClick)='toolbarClick($event)'
(toolbarCreate)='toolbarCreate($event)'>
</ejs-filemanager>
[app.component.ts]
public view: string;
public toolbarSettings: object;
...
this.toolbarSettings = {
items: [
'NewFolder',
'Upload',
'Delete',
'Download',
'Rename',
'SortBy',
'Refresh',
'Selection',
'DetailsView',
'LargeIconsView',
'Details'
]
};
}
toolbarClick(args: ToolbarClickEventArgs) {
if (args.item.text === 'DetailsView') {
//Swiches to Details view
this.view = 'Details';
}
if (args.item.text === 'LargeIconsView') {
//Swiches to LargeIcons view
this.view = 'LargeIcons';
}
}
toolbarCreate(args: ToolbarCreateEventArgs) {
for (var i = 0; i < args.items.length; i++) {
var id = args.items[i].id;
var root = this.fileManagerInstance.element.id;
switch (id) {
case root + '_tb_detailsview':
//Add icon for details view button
args.items[i].prefixIcon = 'e-icons e-fe-grid';
break;
case root + '_tb_largeiconsview':
//Add icon for large view button
args.items[i].prefixIcon = 'e-icons e-fe-large';
break;
}
}
} |
Hi,
After adding this, we are not able to see the button selected/focused on the first load as we have set our view to 'Details' view.
We want to toggle between the buttons and keep the selected view as focused from the buttons.
Ho can we set the button focused on the first load and then toggle the buttons based on selection. We tried using the the created event and toolbarclick event but it didn't work well.
Thanks in advance.
Hi,
Thanks you for your solution, We have done with the same approach and its working fine, wanted to ask if any better solution is available. Anyway the previous solution is working. Hence you can close this query if no other optimized solution is available.
Thanks.