Welcome Guest Search | Active Topics | Sign In | Register

Detect Which Button Was Clicked in a Grid EditCommandColumn Options
David
Posted: Wednesday, December 1, 2010 4:36:55 AM
Rank: Advanced Member
Groups: Member

Joined: 10/21/2009
Posts: 39
When a grids EditCommandColumn edit button is clicked the row goes into edit mode for me.
Now how can I detect whether the Update button or the Cancel button gets clicked in my ClientSideAfterEditItem javascript function?
David
Posted: Wednesday, December 1, 2010 5:08:47 AM
Rank: Advanced Member
Groups: Member

Joined: 10/21/2009
Posts: 39
Also is there a javascript way to know if anything has changed or been added in the grid when the Update button and the Cancel button get clicked. Something like a clientside version of the serverside ChangedItems and AddedItems properties.
eo_support
Posted: Wednesday, December 1, 2010 9:04:14 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

The second argument of your ClientSideAfterEditItem is true if Update is clicked, false if Cancel is clicked.

There is no single interface for you get a list of changed items or added items on the client side. If you need such a list, you must use ClientSideAfterEditItem to build such a list. Inside the handler you can compare the modified item's index with the initial total number of items in the Grid. If the item's index is greater than that value, then this is a newly added item and should go to your "AddedItems" collection. Otherwise it should go to your "ChangedItems" collection.

Your one year free tech support has actually expired recently, so you may want consider an upgrade to the current version. The upgrade cost $105 and it will give you a few new controls and also another year of free upgrade and tech support.

Thanks!
David
Posted: Wednesday, December 1, 2010 8:10:34 PM
Rank: Advanced Member
Groups: Member

Joined: 10/21/2009
Posts: 39
That will work for me but I cannot find an example in your docs or sample site that lists all the parameters of ClientSideAfterEditItem. Can you please let me know what they are are where to find parameters for the other clientside events as well.

Thanks.
David
Posted: Thursday, December 2, 2010 1:26:48 AM
Rank: Advanced Member
Groups: Member

Joined: 10/21/2009
Posts: 39
I just placed an upgrade order, thanks for letting me know about that.
I am calling grid.editItem in a javascript function and after the function executes, a post back occurs. How can I stop this postback from happening? I tried putting the grid in an ASP Update Panel but that didn't help. When I comment out the call to editItem, no postback occurs.
Thanks.
eo_support
Posted: Thursday, December 2, 2010 8:19:52 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

Here is the parameters information for ClientSideAfterEditItem:

http://doc.essentialobjects.com/library/1/jsdoc.public.handlers.grid_itemevent_handler.aspx

To find parameters for any client side event, just check the reference for that property in the document. For example, you will find a link to the above link the reference for ClientSideAfterEditItem:

http://doc.essentialobjects.com/library/1/eo.web.grid.clientsideafteredititem.aspx

We are not aware that editItem would cause post back in any case. So the problem might originate from somewhere else. Try to comment other code out block by block and see if you can find out what it is. If not, try to isolate the problem into a test page and we will be happy to take a look. Please make sure the test page contains only code needed to reproduce the problem and runs independently.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.