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

how to identify grid form cancel button click

1 Answer 73 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Rahul
Top achievements
Rank 1
Rahul asked on 06 Jan 2011, 12:18 PM
How to identity gird cancel button click . In javascript .

I want to identitfy the cancel button is click on client side.

1 Answer, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 06 Jan 2011, 01:06 PM
Hello Rahul,

You can attach the client event OnCommand. This will be raised for each grid command which is about to be triggered (sorting, paging, filtering, editing, etc.) before postback/ajax request except hierarchy/grouping expand/collapse action.

aspx:
<ClientSettings>
              <ClientEvents OnCommand="RaiseCommand" />
<ClientSettings>

JavaScript:
function RaiseCommand(sender, args)
{
       if (args.get_commandName() == "CancelUpdate")//check for the condition
      {
           //your code here
       }
   }

 Also refer the following documentation for more on this:
OnCommand

Thanks,
Shinu.
Tags
Grid
Asked by
Rahul
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or