Welcome Guest Search | Active Topics | Sign In | Register

treeview postback on checkbox click Options
uwe
Posted: Monday, March 22, 2010 4:12:39 AM
Rank: Member
Groups: Member

Joined: 12/16/2007
Posts: 20
Hi ,
who can I achive, that the treeview control sends a postback (fires ItemCheckStateChanged event ) immediately after the user (un)checked a nodes checkbox .
( like the ItemClick event).

many Thanks
Uwe
eo_support
Posted: Monday, March 22, 2010 9:13:04 AM
Rank: Administration
Groups: Administration

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

I believe you can handle the TreeView's ClientSideOnCheckStateChanging event to catch the checkbox click event. You can do a post back inside that event handler but make sure you delay the call with setTimeout because when the handler is called, the checkbox status has not changed yet.

Thanks!
uwe
Posted: Tuesday, March 23, 2010 1:08:33 PM
Rank: Member
Groups: Member

Joined: 12/16/2007
Posts: 20
Uwe 3.May 2010 Correction: there was an error - this code works:

<script type=text/javascript>
function on_item_check(tv, node,curstate,prevstate) { setTimeout(function () { __doPostBack(node.getNavigator().getId(),node.getIndex()); }, 10); }
</script>

Many Thanks
the following code did the job !
Uwe


<eo:TreeView ID="TreeView1" runat="server" ... ClientSideOnCheckStateChanging="on_item_check" ....


<script type="text/javascript" >
function on_item_check(e, info) { setTimeout(function () { __doPostBack(e,info); }, 10); }
</script>



eo_support
Posted: Tuesday, March 23, 2010 1:10:46 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Great. Glad that it works for you!


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.