Hey Everyone,
I am trying to mask the tool items (inline actions) in the folder browser widget using the “ToolItemsMask” by following CSUI SDK documentation.
In order to achieve this task, I have created the folder browser widget.
csui.onReady2([
"csui/lib/jquery", 'csui/integration/folderbrowser/folderbrowser.widget'
], function ($, FolderBrowser) {
var folderBrowser = new FolderBrowser({
connection: connection,
start: {
id: id
},
breadcrumb:true
});
folderBrowser.show({
placeholder: '#content'
})
});
To masking the inline action tool item, I have followed the CSUI SDK documentations of ToolItemsMask (/docs/Toolitems.mask).
I have used blacklist to put the signatures which I need to disable.
// Mask populated by an action blacklist
mask = new ToolItemsMask({
blacklist: ['Copy', 'Move']
});
I didn’t create the toolteamsFactory because folder bowser widget has the signatures. But I have tried to follow rest of the structure for masking the toolitem.
/ / Status object for action execution
status = {
nodes: new Backbone.Collection()
};
// Create a filterable collection of tool items to support a context menu
filteredToolItems = new FilteredToolItemsCollectmition(toolItemsFactory, {
status: status,
commands: commands,
mask: mask
});
// Mask a collection of tool items by the action mask
// using "passItem" and then check the ection permissions
finalToolItems = toolItems.filter(function (toolItem) {
if (mask.passItem(toolItem)) {mit
var signature = toolItem.get('signature'),
command = commands.get(signature);
return command && command.enabled(status);
}
});
/ Mask a collection of tool items by the action mask
// using "passItem" and then check the ection permissions
finalToolItems = toolItems.filter(function (toolItem) {
if (mask.passItem(toolItem)) {mit
var signature = toolItem.get('signature'),
command = commands.get(signature);
return command && command.enabled(status);
}
});
There are few variables which I don’t understand in manner to how to use it and where to use it.
- FilteredToolItemsCollectmition: Is the same which FilteredToolItemsCollection (csui/controls/toolbar/toolitems.filtered.model) ?
- Commands and Status: where can I need get those values?
- toolItems: where can I get toolItems value to pass as argument or is it “toolItemsFactory” ?
- filteredToolItems and finalToolItems: where do I need to use those function values to make it work?
- There are two function for finalToolItems in documentation which one I need to use?
I have tried to use different scenario to make it work but it is not working.
Can you please provide any guidance to how can I mask the toolitem in folder browser? Or I need to use nodestable or any other widget/control for masking.