Persist node Enable/Disable across post back

7 posts, 0 answers
  1. david terek
    david terek avatar
    10 posts
    Member since:
    Apr 2008

    Posted 30 Jan 2009 Link to this post

    This issue is related to another form post, but slightly different regarding maintaining state of the tree view nodes changed by client side code across post back.

    I have four nodes w/Check boxes
    A
    B
    C
    D

    When A is clicked, if it is checked, it will disable and uncheck every other node.  If A is unchecked it will re-enable all other nodes.
    What I have found is that if I check B, and then check A, post back, I get my expected result - only A checked with all others disabled and unchecked.
    Now, if I uncheck A (which re-enables everything), on the next post back all the other nodes are once again disabled.  As if the enable/disable did not persist across the post back (yet it did the first time?).

    Code below (code behind is empty):

    1     function TVOnNodeChecked(sender, e)  
    2     { 
    3         var Tree = $find('<%=rtvTest.ClientID %>'); 
    4         var TreeNodes = Tree.get_allNodes(); 
    5         var ClickedNode = e.get_node(); 
    6  
    7         if (ClickedNode.get_value() == 1)  
    8         { 
    9             Tree.trackChanges(); 
    10             for (var i = 0; i < TreeNodes.length; i++)  
    11             { 
    12                 var thisNode = TreeNodes[i]; 
    13                 var thisNodeCB = thisNode.get_checkBoxElement(); 
    14                 if (thisNode.get_value() != 1)  
    15                 { 
    16                     if (ClickedNode.get_checked()) { 
    17                         thisNode.set_checked(false); 
    18                         thisNode.set_enabled(false); 
    19                     } 
    20                     else  
    21                     { 
    22                         thisNode.set_enabled(true); 
    23                     } 
    24                 }             
    25             } 
    26             Tree.commitChanges(); 
    27         } 
    28     } 

    1 <asp:Panel ID="pnl1" runat="server"
    2     <telerik:RadTreeView ID="rtvTest" runat="server" CheckBoxes="true" CheckChildNodes="true"  OnClientNodeChecked="TVOnNodeChecked"
    3         <Nodes> 
    4             <telerik:RadTreeNode Text="Node1" Value="1"></telerik:RadTreeNode> 
    5             <telerik:RadTreeNode Text="Node2" Value="2"></telerik:RadTreeNode> 
    6             <telerik:RadTreeNode Text="Node3" Value="3"></telerik:RadTreeNode> 
    7             <telerik:RadTreeNode Text="Node4a" Value="-1"
    8             </telerik:RadTreeNode> 
    9         </Nodes> 
    10     </telerik:RadTreeView> 
    11  
    12 </asp:Panel> 
    13  
    14 <br /> 
    15 <asp:Button ID="btnPostback" runat="server" Text="Go go Postback" /> 


    Telerik control version is 2008.03.1314.35
  2. Yana
    Admin
    Yana avatar
    4781 posts

    Posted 03 Feb 2009 Link to this post

    Hello David,

    We need some more time to investigate this issue. You'll be informed once we're ready. Thank you for your patience.

    Best wishes,
    Yana
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. david terek
    david terek avatar
    10 posts
    Member since:
    Apr 2008

    Posted 03 Feb 2009 Link to this post

    I understand.  Thank you for examining this issue.
  4. david terek
    david terek avatar
    10 posts
    Member since:
    Apr 2008

    Posted 25 Feb 2009 Link to this post

    Any progress on this issue?
  5. Yana
    Admin
    Yana avatar
    4781 posts

    Posted 26 Feb 2009 Link to this post

    Hi David,

    I am sorry for the delayed reply.

    This seems to be a bug in RadTreeView and will be fixed. Thank you for reporting it.

    Best wishes,
    Yana
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  6. david terek
    david terek avatar
    10 posts
    Member since:
    Apr 2008

    Posted 29 Apr 2009 Link to this post

    Was this issue fixed in the Q1 2009 release?
  7. Yana
    Admin
    Yana avatar
    4781 posts

    Posted 30 Apr 2009 Link to this post

    Hi David,

    I'm afraid that the problem is not solved in the Q1 2009 release, we'll address it as soon as possible, you'll be informed once it's ready. Thank you for your patience.

    Best regards,
    Yana
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Back to Top