1. #1
    Sencha User
    Join Date
    Mar 2012
    Posts
    10
    Vote Rating
    0
    Kevin Mitchell is on a distinguished road

      0  

    Default Unanswered: Example of TreeStore/NestedList with add/delete?

    Unanswered: Example of TreeStore/NestedList with add/delete?


    I can successfully display a nested list/tree store where the data is loaded via ajax. But I'm having problems adding items to the store, with the display of the tree nodes getting very confused (duplicated children etc). Looking on the web I can see lots of people having problems figuring out how to dynamically alter nested lists/tree stores, but I've not come across any good examples of how to do this. Does the absence of such examples suggest that there are currently bugs in the implementation of these features that make it difficult to write such examples? Or do examples exist and I'm just looking in the wrong place?

    Thanks

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,754
    Answers
    3462
    Vote Rating
    827
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    What have you tried?
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Mar 2012
    Posts
    10
    Vote Rating
    0
    Kevin Mitchell is on a distinguished road

      0  

    Default


    I define a model:


    Ext.define('GS.model.Tag', {
    extend: 'Ext.data.Model',
    config: {
    fields: [
    { name: 'tag', type: 'string' }
    ]
    }
    });


    And a store:


    Ext.define("GS.store.Tags", {
    extend: "Ext.data.TreeStore",
    config: {
    model: "GS.model.Tag",
    autoLoad: true,
    defaultRootProperty: 'children',

    proxy: {
    type: 'ajax',
    url : 'server/tags.php'
    }
    }
    });




    The view shows two top-level entries in the nested list, "location" and "equipment".


    I then insert a new entry into the store using this:


    var store = Ext.getStore("Tags");
    store.getNode().appendChild({tag:'wibble', leaf:true});
    store.sync();


    When I execute these statements I get a new child added at the end. But the top-level entries are now displayed as "location", "location" and "wibble". So the "equipment" entry has changed name to "location".


    I'm probably doing something silly, but it seemed odd there wasn't an example of a dynamically changing nested list as one of the Sencha examples. The examples tend to be very helpful, and as nested lists/tree stores are one of the more complicated parts of the library examples would be even more helpful for such cases.

Thread Participants: 1

Tags for this Thread

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi