Hi all,
I'd like to create a shortcut widget which allows to dynamically assign items to it.
Thanks to the documentation and some source code exploration I'm pretty close, but I am still missing the possibility to trigger a browse within the same screen (as the standard widget does).
I think I need to look in the direction of the Context I am using, since the shortcuts will open in a new window if I use the PortalContext, but I'd like to be able to use a standard browse.
I saw the example in the documentation alerting the document ID on change event but since the shortcut view includes a defaultaction command with the onclick event I am not sure if I need to implement it that way?
Anyway, here's my code, this lists the shortcuts just fine, the document opens in a new popup but the folder/enterprise objects don't do anything.
csui.require([
'csui/lib/underscore', // Cross-browser utility belt
'csui/lib/marionette', // MVC application support
'csui/lib/jquery',
'csui/utils/contexts/page/page.context',
'csui/widgets/shortcuts/shortcuts.view'
], function (_,Marionette, $,PageContext,ShortcutsView) {
var shortcutRegion = new Marionette.Region({el: '#shortcutRegion'}),
pageContext = new PageContext(),
shortcutsView,
options={
context:pageContext,
data: {
shortcutItems:[
{type:141},
{id:130196},
{id:94507}
],
shortcutTheme:'csui-shortcut-theme-teal1'
}
}
shortcutsView = new ShortcutsView(options);
shortcutRegion.show(shortcutsView);
pageContext.fetch();
});
Thanks in advance for the help
Jasper