How to access the cancel button event in jQGrid Edit dialog box - jqgrid

Is there an event associated with the cancel button of various jQGrid dialog boxes like ADD, Edit and Delete ? For my edit dialog box, I need to do some processing when the user clicks the cancel button.
please help
thanks

Probably it could be enough to use onClose callback for form editing (see the documentation here and here).
If you would fund out that the callback are called not allays (I don't tested it in the current version of jqGrid) then you can choose another way. If you really need to process all closing of all dialogs you can consider to overwrite or to subclass $.jgrid.closeModal or $.jgrid.hideModal functions. See the demo from the answer (compare the code with original one here).

Related

Disable 'Warning Dialog' in jqgrid Edit/Delete

I'm using jqgrid inline edit in my application which is also accessed in mobile. Since the user access space in the mobile is small i dont want the pop-up's throwing in the middle.
So, basically when the user did not select the row and click the edit/delete button the warning dialog is thrown "Please, select a row". Now i did not want the alert. Just when the user click on the edit/delete button without selecting the row it should stand still. Nothing happens.
Is this possible? How can i achieve this?
I would suggest you another way. One can disable or hide Delete/Edit buttons until a row will be selected. Inside of loadComplete one should test whether any row is selected (it could be selected if you use reloadGrid with {current:true} option for example). In the case you can disable or hide Delete/Edit buttons once more.
The demo created for the old answer shows how to disable navigator buttons by adding ui-state-disabled class. Another demo created for the answer demonstrates in interactive form how to show/hide navigator buttons.

Flexicious DataGrid FlexDataGirdEvent.EDIT_END special case

I have a Flexicious DataGrid set up, and I have an ItemRenderer set on a certain column. Now, when I am editing an editable cell, and then stop editing it, the DataGrid fires a FlexDataGrid.EDIT_ITEM_END event (or something like that). When this is fired, I want to do a certain action. That's simple enough. The problem though, is I have a special case:
If a user is editing an editable cell and then clicks away from it (which would cause FlexDataGrid.EDIT_ITEM_END fire), but he happens to click on a button which is within the ItemRenderer set on the column, then in that case I don't want to do the action. I don't know how to make an event work like this though.
Basically I'm looking for an event that is FlexDataGrid.EDIT_ITEM_END_AND_CLICKED_ON_ANYTHING_OTHER_THAN_THAT_BUTTON and I'd like to fire that instead of FlexDataGrid.EDIT_ITEM_END. But alas, I checked the docs and that event doesn't exist =-(.
What can I do? Thanks for the help!
Have you tried ITEM_EDIT_CANCEL? This has a triggerEvent which should have a target property that should tell you what display object the click happened on.

JQGrid row action menu

Is there a way in JQ-Grid to display an icon for each row which will open a drop down menu with a list of actions/links?
Thanks
There are no standard implementation of the behavior. You can implement what you need with respect of the custom formatter.
You can try to use formatter:'actions' as alternative way. In the answer I shows how to extend standard actions buttons with custom buttons. In another answer (see the demo) I shows one more way how to implement very close behavior as formatter:'actions' do but with respect on another events.

How to allow cell navigation in SlickGrid with a Validation Error?

I've noticed that when a validation error occurs, the user is locked into that cell until the error is resolved. Is there a way to allow the user to continue to navigate cells?
This approach works for me b/c I don't commit when they leave the cell, but wait until they click a Save button. So, this button would be disabled while an error exists, but they are still free to navigate cells. Thank you.
You need to implement your own editorLock function, that is passed to options. This feature, just as most of SlickGrid, is poorly documented, ut you can watch through source code of SlickGrid, and search for function called commitCurrentEdit.
The example of editorLock is in the file slick.core.js
Also, before rendering the grid you can try to do this:
Slick.GlobalEditorLock.commitCurrentEdit = function(){
return true;
}

How can i add a MouseDown event handler to a <asp: button> control?

I have a aspx page that contain "asp:RequiredFieldValidator" controls;Problem that is when each of "asp:RequiredFieldValidator" controls activate and show their messages; other controls in my page don't working even "CANCEL" button!!!
i want to enable controls in my "NEXT" button MouseDown and then disable them at my "NEXT" button MouseUp.
Thanks for any other solutions...
Specifically to answer your question as stated in your title: to add additional event handlers to an asp:button or other server controls that are not composite you simply add the handler to the element. Include onmousedown="myMouseDownHandler(this);" in the element and the javascript function myMouseDownHandler will fire.
However, I think there is a better way to do what your asking but the description of the question is not coherent enough for me to quite figure out what you're asking. I realize you may not be a native English speaker but perhaps you could give it another pass.
Use ValidationGroup property on controls that are validated and controls that triggers validation (e.g. save/update buttons) and on validators. Additionally set CausesValidation property to false on each button that does not need to trigger validation (cancel button).

Resources