get xml client side

7 posts, 1 answers
  1. Kieran
    Kieran avatar
    23 posts
    Member since:
    Feb 2009

    Posted 14 Jan 2010 Link to this post

    Hi

    Is there anyway of rendering the xml representation of a treeview using javascript? maybe using json/jayrock?

    The xml can be obtained when a node is expanding however as the trewview isn't set to serverside the collapse node event is not fired. Is thereanyway around this? Need to store the state of the treeview which works fine when a user expands a node but when they collapse a node the change can not be captured

    Any help much appreciated? It is not viable to put the treeview in an updatepanel

    Thanks
    Kieran
  2. Veselin Vasilev
    Admin
    Veselin Vasilev avatar
    2992 posts

    Posted 19 Jan 2010 Link to this post

    Hi Kieran,

    The current version of RadTreeView does not have a method to convert the state of the tree to XML with javascript. There is a server method - GetXml() which does exactly what you need.

    Can you elaborate a bit more about your exact scenario so we can think of any alternative approaches?

    Kind regards,
    Veskoni
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. John
    John avatar
    88 posts
    Member since:
    Nov 2007

    Posted 28 Jan 2010 Link to this post

    I too have a need for getting the XML of a tree client side.

    In my scenario I have RadMenu with a RadTree inside of the drop down.  I wish to save the Tree State Server side on expand/collapse.  I originally put it in an ajaxpanel but when the ajax postback occurs, my Radmenu would close on me.  So what I would like to do is use a RadXmlHttpPanel do the saving for me since I don't really need a full post back or to do anything with the results, just fire, save, and forget.


    So I have an RadXMLHTTPPanel with nothing in it, and an OnServiceRequest method that does the saving.  But I can't get the state of the tree from the OnServiceRequest since the radxmlhttppanel doesn't know what it is.

    So I figured I could use OnClientNodeCollapsed and OnClientNodeExpanded methods of the tree to call the RadXmlhttpPanel to send it the state.

            function RadTreeView_Admin_NodeChange(sender, eventArgs) { 
                var panel = $find("<%=RadXmlHttpPanel1.ClientID%>"); 
                var txt =  eventArgs.getXML(); 
                panel.set_value(txt); 
            } 

    but since there is no client side getXML, i'm out of luck.

    Any ideas on how to accomplish this?

  5. Answer
    Veselin Vasilev
    Admin
    Veselin Vasilev avatar
    2992 posts

    Posted 03 Feb 2010 Link to this post

    Hi John,

    Please download a sample project from here.

    Regards,
    Veskoni
    the Telerik team

    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
    Follow the status of features or bugs in PITS and vote for them to affect their priority.
  6. John
    John avatar
    88 posts
    Member since:
    Nov 2007

    Posted 03 Feb 2010 Link to this post

    Thanks Veskoni that works, my original approach had I made it way more complicated then it needed to be.  Thanks

    John
  7. D
    D avatar
    1 posts
    Member since:
    Jun 2012

    Posted 04 Jun 2012 Link to this post

    Any chance an example of this is still around? Need to do the same thing.
  8. Plamen
    Admin
    Plamen avatar
    2731 posts

    Posted 07 Jun 2012 Link to this post

    Hello D,

     
    It seems that the example is not available. Would you please elaborate a little bit what exactly are you trying to achieve so we can try to provide you with the appropriate solution?

    All the best,
    Plamen Zdravkov
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017