Welcome Guest Search | Active Topics | Sign In | Register

ListBox ItemTemplate Options
Brad Coble
Posted: Monday, July 23, 2012 2:05:33 PM
Rank: Advanced Member
Groups: Member

Joined: 2/4/2009
Posts: 31
Hi!

I have a ASP Checkbox inside an ItemTemplate I would like to read when the user clicks a selection. Doable?

Thanks!
eo_support
Posted: Monday, July 23, 2012 4:48:01 PM
Rank: Administration
Groups: Administration

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

You would do something like this:

Code: C#
CheckBox cb = (CheckBox)ListBox1.Items[0].Container.FindControl("CheckBox1");
cb.Checked = true;


Thanks!
Brad Coble
Posted: Monday, July 23, 2012 5:15:02 PM
Rank: Advanced Member
Groups: Member

Joined: 2/4/2009
Posts: 31
Thanks, I should have been more clear. I was looking for a client side solution. Trying to avoid the round trip to the server. Nothing in the client objects jumps out at me, but thought I would ask the experts :)
eo_support
Posted: Monday, July 23, 2012 5:23:43 PM
Rank: Administration
Groups: Administration

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

From the client side the furthest you can get from the Grid is calling this method to get the root DOM element of a Grid cell:

http://www.essentialobjects.com/doc/1/jsdoc.public.gridcell.getdomelement.aspx

Once you are there, everything else is yours.

Thanks!
Brad Coble
Posted: Monday, July 23, 2012 5:40:15 PM
Rank: Advanced Member
Groups: Member

Joined: 2/4/2009
Posts: 31
Ok, I dont see anything like that in the ListBoxItem object? I have version 2011, something newer perhaps?
eo_support
Posted: Monday, July 23, 2012 5:54:55 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,195
Sorry we mixed up it with the Grid. ListBoxItem does not have this yet. We might have to add one for this.

Thanks!
eo_support
Posted: Tuesday, July 24, 2012 12:51:28 PM
Rank: Administration
Groups: Administration

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

We have added getDOMElement on the client side ListBoxItem object. The code will be something like this:

Code: JavaScript
//Get the ListBox object
var lb = eo_GetObject("ListBox1");

//Get the DOM element for the first item
var e = lb.getItem(0).getDOMElement();


Please see your private message for the download location of the new build.

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.