Question is simple: Is there a way to override the behaviour of the default buttons placed in the navigation bar of a jqGrid grid?
I'm using the struts2 plugin and I needed to launch an action if user clicks the add button or the edit button to redirect to another page in which this things are done. I wondered if it was possible to override it's default behaviour as I think it's cleaner than defining myself new "add" and "edit" buttons.
Documentation for adding such new buttons HERE.
You create first navigator bar using navigator="true", but with navigatorAdd="false", navigatorEdit="false", navigatorDelete="false" and so on (see the documentation). In the way you will have navigator bar without any buttons. Then you add custom buttons with the same icons like standard editing buttons (see the example which you referenced). You need uses icon: 'ui-icon-pencil' for Edit, ui-icon-plus for Add, and ui-icon-trash for delete. Inside of onclick callback you can place any your custom JavaScript code.
UPDATED: The names and the values of navigatorExtraButtons are build based on the options of navButtonAdd method. I've found additionally this code which should help you.
Related
I've managed to customize the header and highlight dropdowns for CKEditor 5 – classic editor build by creating a new custom build.
But I don't know how to add additional buttons to the toolbar. For example a fullscreen button.
Current progress: github link
If you want to add existing buttons to the main toolbar, then you need to configure the config.toolbar. In your example it corresponds to these lines.
There's no fullscreen button at this moment. You can add +1 to the https://github.com/ckeditor/ckeditor5/issues/1235 to increase its priority or try to implement this feature on your own.
Basically, to create your own button you need to create a plugin which registers the button in the component factory and adds some actions that will be performed on the buttonView:execute event. You can follow the steps described in creating a simple plugin guide.
A good and complementary reading about the UI library can be found here.
In Apex 5.0 working with Interactive reports I am able to take the functionality from the action menu buttons and use them in a button. The code I use is:
javascript:$("#CloseoutReport_actions_menu").menu("find","irDownload").action()
The CloseoutReport is the static Id of my interactive report and the action i chose to use is the Download function. Now this works when I have the action menu set to show, but when I hide the action menu, this no longer works. Is it a possibility to do what I am trying when I hide the action bar? I just want to show a single button with the download option. Thanks for any comments or answers.
There are more solutions to your problem but the most easy one i think is to add display:none to the class of the action bar.
Like this:
.a-IRR-toolbar {
display: none;
}
The difference between setting the item to display: none and setting the action bar to not show is that in the second case the database does not send any javascript of the action bar to your browser so you can not use its functionalities but in the first case you get all the functionalities but you hide them.
You want to have a simple download button? In this case you can simply create a button with request IR[CloseoutReport]_CSV.
Example for manual link: https://foo.bar:1234/pls/apex/f?p=100:2:123456:IR[CloseoutReport]_CSV.
I want to re-create the view given in the site under the Base Score Metrics, when I click on it would expand and another click would collapse the details included in it.
I don't think this is native html functionality perhaps I have to use some third party plugin for it. Please tell me know how can I achieve the effect coded in the website given in the example.
Collapsed view
Expanded view
Thanks.
JQuery's UI framework, specifically jqueryui.com/accordion, allows you to do just that.
You can put any elements inside those tabs, and it will work as if it were a static page.
I use a Dojo Enhanced Grid to display various data. With a DropDownMenu I give the user the ability to show additional colums.
But this is a little bit uncomfortable. Because the user has to click for every new colum onto the menu.
Is there a possibility to prevent the DropDownMenu from closing? Or should I use another widget for this?
I'd suggest you look into Dojo dgrid, and the ColumnHider extension. It effectively recreates what you're doing, and is available out-of-the-box, including the feature you're after.
An alternate solution is to use a dijit/TooltipDialog, whose default behavior is to stay open when one of its contents is clicked.
yourGrid.openDropDown(); will open the menu back again, and you would not really notice that it was displayed back again after a close.
I have written some javascript and attached it onto the onSave event of an entity to perform some actions when a record is deactivated. This works fine when on the form but if a user decides to deactivate the record from the entity view then this code does not get fired. Is there a way that I can attach this event to deactivating from here?
Thanks
You'll have to create plugin if you want to perform some action that doesn't take place on the actual form itself, or a button on the ribbon. See this similar question
You can use the a Ribbon Editor to edit the "deactivate" Ribbon Button in the homepage grid to include a javascript function in a webresource. So when it is clicked the button will trigger your javascript code.
the only adjustment you have to make is to accept an input parameter given by the ribbon button.
You just need to make a RibbonButton and set a control so that it will return all the id's of the active grid. In the link you will have the "SelectedControlSelectedItemIds" but you have more options available.
if you alter the XML of the solution. Your function will require a parameter.
function getSelectedItems(arrayOfIDS){
for(var i = 0; i < arrayofIDS.length;i++)
{
//Your implementation here
}
}
Alternatively you can choose to write a plugIn like Daryl suggests
EDIT: Ribbon Workbench: With this tool you can customize system buttons with visual ribbon button you can't.