Welcome Guest Search | Active Topics | Sign In | Register

Client-side events for checkboxes in Grid? Options
Brett Grimes
Posted: Tuesday, August 12, 2008 4:23:21 AM
Rank: Newbie
Groups: Member

Joined: 8/12/2008
Posts: 1
Hello,

I am trying to access events for checkboxes in a column in the Grid object. I need to be able to enable/disable other interface elements (e.g., buttons) based on the state of the checkboxes on the client-side, updating as the changes happen.
The ItemChanged event would appear to be what I am looking for here, except that it does not occur after each change. Is there another event I can use or any way to get ItemChanged to fire on a per-change basis on the client-side?

Thanks,
Brett Grimes
eo_support
Posted: Tuesday, August 12, 2008 7:39:45 AM
Rank: Administration
Groups: Administration

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

Unfortunately we are not aware of an easy way to do that now. We have a new build that should come out soon and it supports ClientSideBeforeEditItem and ClientSideAfterEditItem. We will see if that can cover the situation.

Thanks
the kid
Posted: Wednesday, August 27, 2008 6:21:54 AM
Rank: Member
Groups: Member

Joined: 7/29/2008
Posts: 14
eo_support wrote:
Hi,

Unfortunately we are not aware of an easy way to do that now. We have a new build that should come out soon and it supports ClientSideBeforeEditItem and ClientSideAfterEditItem. We will see if that can cover the situation.

Thanks


Yes, there is a way how to do it. Instead checkbox column create a custom column:

<eo:CustomColumn Width="30" ClientSideGetText="on_column_gettext">
<CellStyle CssText="MARGIN: 0px; PADDING-LEFT: 2px;" />
</eo:CustomColumn>


and write javascript functions:

function on_column_gettext(column, item, cellValue)
{
return "<input type=\"checkbox\" id=\"checkbox" + item.getIndex() + "\" onclick=\"check_rows(" + item.getIndex() + ")\"/>";
}

function check_rows(rowIndex)
{
alert("Three things are certain: Death, taxes, and lost data. Guess which has occurred.");
}

Try it!
eo_support
Posted: Wednesday, August 27, 2008 6:34:41 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,093
Thanks for sharing!

If you wish to raises server side event, you can replace alert with:

Code: JavaScript
eo_GetObject("Grid1").raiseItemCommandEvent(rowIndex, "anything");


This will cause server side ItemCommand event.

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.