Hello,
I'm trying to extend the default actions menu of an IG by adding a menu voice labeled "Upload" (I want my users to be able to upload records from a .csv file and I don't want to add a button outside the existing menu).
I've found this javscript code in the IG documentation that seemed a good starting point:
function( options ) {
options.initActions = function( actions ) {
// Hide all elements associated with the show help dialog action
actions.hide( "show-help-dialog" );
// Add a keyboard shortcut to the show filter dialog action
actions.lookup( "show-filter-dialog" ).shortcut = "Ctrl+Alt+F";
actions.update( "show-filter-dialog" );
// Add new actions, either singularly passing in an actions object as shown here, or in // multiple by passing an array of action objects
actions.add( {
name: "my-action", label: "Hello", action: function( event, focusElement ) {
alert( "Hello World!" ); }
} );
};
return options;
}
The problem is that while hiding and updating actions work as expected, there is no way to add the "Hello" action: what am I doing wrong ?
Thank you.