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
|
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!
|
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>
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Great. Glad that it works for you!
|