Results 1 to 5 of 5

Thread: Update a memory type proxy store with new data?

  1. #1
    Sencha Premium Member
    Join Date
    Nov 2008
    Posts
    62
    Vote Rating
    1
      0  

    Default Update a memory type proxy store with new data?

    Hi, I have a local variable with JSON data which I modify realtime. I load this variable as data in a NestedList component via store.

    This is the variable:
    Code:
    var UInavPanel = {text:'My nav',items:[{text:'item1'},{text:'item2'}]};
    This is my TreeStore:
    Code:
    var leftPanelstore = new Ext.data.TreeStore({
        model: 'LeftPanelListItem',
        root: UInavPanel,
        //autoSync:true,
        autoLoad: true,
        proxy: {
            type: 'memory',
            reader: {
                type: 'json',
                root: 'items'
            }
        }
    });
    This builds the NestedList with only the initial data, it doens'update it when a change in UInavPanel happens. How could be this done? I need when I modify the JSON data in UInavPanel, the nestedlist to rebuilds itself with the new data.

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,551
    Answers
    3931
    Vote Rating
    1271
      0  

    Default

    Have you tried using loadData to load new data into the Store?
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  3. #3
    Sencha Premium Member
    Join Date
    Nov 2008
    Posts
    62
    Vote Rating
    1
      0  

    Default

    Yes, I've tried, but it seems TreeStore doesn't have loadData method.

  4. #4
    Sencha Premium Member
    Join Date
    Nov 2008
    Posts
    62
    Vote Rating
    1
      0  

    Default

    Any other suggestion?

  5. #5
    Sencha Premium Member
    Join Date
    Nov 2008
    Posts
    62
    Vote Rating
    1
      0  

    Default

    I solved it, but the solution seems dirty. The TreeStore has a method setRootNode(). I use it to load the changed object.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •