This is a migrated thread and some comments may be shown as answers.

Identify The Button clicked in batcheditcommand

1 Answer 63 Views
DataForm
This is a migrated thread and some comments may be shown as answers.
Siva
Top achievements
Rank 1
Siva asked on 20 Feb 2016, 02:09 AM

I have a RadGrid that is enabled with batch edit. I have two buttons in the command template Add and Save. 

Add Button will open a modal dialog, with out saving the changes made to rad grid.

Save Button will save changes using client settings

Now I need to change the Add Button to save changes before opening the modal dialog.

I am unable to identify the button that invoked the BatchEditcommand so that i can call the 

How can I achieve this.

 

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 24 Feb 2016, 07:20 AM
Hi Siva,

You try using the OnCommand or OnUserAction event handlers to achieve that via the document.ActiveElement reference. Some time ago, there was only the OnCommand event handler, which could be used to cancel grid commands on client-side. This would prevent the command to post back to the server, however, some commands like PageSize, Sorting, etc. also contain client-side logic like hiding the pager item and changing the status of the sort icon in the header cell of a column. Therefore, our developers introduced this additional event handler OnUserAction, which primary goal was to provide a convenient way of canceling these commands, which have client-side logic applied in addition to the server-side event raising. It will be fired for these commands: "Page", "Sort", "PageSize", "Filter".

I hope the clarification was helpful. The one crucial difference you should note that you have to use get_actionName() instead of get_commandName().

I hope the clarification was helpful.


Regards,
Eyup
Telerik
Tags
DataForm
Asked by
Siva
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or