1. #1
    Sencha User
    Join Date
    Oct 2010
    Location
    Bangalore
    Posts
    28
    Vote Rating
    0
    vajrakumar.d is on a distinguished road

      0  

    Default Loading a Tree with an xml which is getting built inside code

    Loading a Tree with an xml which is getting built inside code


    Hello i want to load a tree with an xml that i am building in the code itself.
    So i cant give dataUrl for the loader.

    If i copy the xml generated & place in a folder & trying to load my tree with this xml then tree is getting loaded.

    But i need to load the tree with xml which is getting built in my code some where in between.

    If i need to use Xmlstore then how to get a local xml file ?

    var tree=new Ext.tree.TreePanel({
    autoScroll: true,
    rootVisible: false,
    root: new Ext.tree.AsyncTreeNode(),
    //loader: treeLoader
    //store: compnyStore
    });

  2. #2
    Sencha User skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,341
    Vote Rating
    248
    skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of

      0  

    Default


    That all sounds very strange. You'd probably be better off keeping your data in the browser as Ext.data.Nodes and only serializing it to XML when you absolutely have to. By keeping the data unserialized it'd make things like creating your tree much simpler.

    Using XmlStore doesn't make sense either. Stores are flat, trees are not.

    If you have an XML string then you could parse it using something like this:

    http://www.w3schools.com/xml/xml_parser.asp

    It probably doesn't make sense to write your own loader, all you need is something to convert XML to nodes then append those nodes to the tree. The method parseXml() in XmlTreeLoader shows you how.

Thread Participants: 1

Tags for this Thread

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar