1. #1
    Sencha User
    Join Date
    Feb 2013
    Posts
    10
    Vote Rating
    1
    invisibled is on a distinguished road

      0  

    Default Unanswered: Updating a Grid store

    Unanswered: Updating a Grid store


    Hey all,

    I'm trying to load some data (michell s touch grid) into my grid, once the grid has already been painted. The grid is being loaded into a panel on startup, with the typical view setup like the examples. Here is my grid store, with some logs on the listeners for debugging.

    Code:
    Ext.define('app.store.BoardsGrid', {
        extend : 'Ext.data.Store',
    
    
        config : {
            model : 'app.model.BoardsGrid',
            listeners: {
                addrecords: function(){
                    console.log("records added!");
                    //Ext.getCmp("boardsGridPanel").add(Ext.create('app.view.BoardsGrid'));
                },
                updaterecord: function(){
                    console.log("records updated");
                }
            }
        }
    });
    The addrecords listener is being called when I add to the store by running this code:
    Code:
    var boardStore = Ext.getStore('BoardsGrid');
                    boardStore.add({
                            "idnumber": "RLB2014",
                            "prep": "n",
                            "press": "n",
                            "shape": "n",
                            "finish": "n"
                    },
                    {
                            "idnumber": "RLB2014",
                            "prep": "n",
                            "press": "n",
                            "shape": "n",
                            "finish": "n"
                    });
    So after this, how do I get the data to show up in my grid? When I log the store object after the add, it shows my new items. I've been looking all day, through the docs and forums to try and find something that will help me but with no luck.

    any suggestions will be greatly appriciated! Thanks.

  2. #2
    Sencha User
    Join Date
    Feb 2013
    Posts
    10
    Vote Rating
    1
    invisibled is on a distinguished road

      0  

    Default


    when i add boardsGrid.sync(); after the add method, the store update listener fires... but still no data in grid hmmm

  3. #3
    Sencha User
    Join Date
    Oct 2012
    Location
    Toulouse
    Posts
    60
    Vote Rating
    0
    Answers
    7
    novadys-sbu is on a distinguished road

      0  

    Default Hello

    Hello


    I also had some issues when trying to get my data to load to the touch grid.
    Are you absolutely sure that the store is loaded (do console.log on the 'load' listener) ?
    And secondly, double (or triple) check the dataIndex are same names as in your model.
    Sarah Burrell
    R & D Developer at Novadys International

  4. #4
    Sencha User
    Join Date
    Oct 2012
    Location
    Toulouse
    Posts
    60
    Vote Rating
    0
    Answers
    7
    novadys-sbu is on a distinguished road

      0  

    Default Although

    Although


    Your problem does seem to be a mapping problem rather than a unloaded store problem
    Sarah Burrell
    R & D Developer at Novadys International

  5. #5
    Sencha User
    Join Date
    Feb 2013
    Posts
    10
    Vote Rating
    1
    invisibled is on a distinguished road

      0  

    Default


    I'd say it's more of trying to reload or refresh the grid view. The grid works fine with sample data, both inline and REST json. If I set the store to autoload true it loads the localstorage from the last load... but obviously I need the current results.

    Thanks for the reply!

  6. #6
    Sencha User
    Join Date
    Apr 2012
    Posts
    9
    Vote Rating
    1
    AnujaSonawane is on a distinguished road

      0  

    Default Can you post the code as to how are you integrating the component into the mvc app

    Can you post the code as to how are you integrating the component into the mvc app


    Pls post the code
    Quote Originally Posted by invisibled View Post
    Hey all,

    I'm trying to load some data (michell s touch grid) into my grid, once the grid has already been painted. The grid is being loaded into a panel on startup, with the typical view setup like the examples. Here is my grid store, with some logs on the listeners for debugging.

    Code:
    Ext.define('app.store.BoardsGrid', {
        extend : 'Ext.data.Store',
    
    
        config : {
            model : 'app.model.BoardsGrid',
            listeners: {
                addrecords: function(){
                    console.log("records added!");
                    //Ext.getCmp("boardsGridPanel").add(Ext.create('app.view.BoardsGrid'));
                },
                updaterecord: function(){
                    console.log("records updated");
                }
            }
        }
    });
    The addrecords listener is being called when I add to the store by running this code:
    Code:
    var boardStore = Ext.getStore('BoardsGrid');
                    boardStore.add({
                            "idnumber": "RLB2014",
                            "prep": "n",
                            "press": "n",
                            "shape": "n",
                            "finish": "n"
                    },
                    {
                            "idnumber": "RLB2014",
                            "prep": "n",
                            "press": "n",
                            "shape": "n",
                            "finish": "n"
                    });
    So after this, how do I get the data to show up in my grid? When I log the store object after the add, it shows my new items. I've been looking all day, through the docs and forums to try and find something that will help me but with no luck.

    any suggestions will be greatly appriciated! Thanks.

  7. #7
    Sencha User
    Join Date
    Feb 2013
    Posts
    10
    Vote Rating
    1
    invisibled is on a distinguished road

      0  

    Default


    Just FYI I have gotten around this by only adding the grid once the store has been populated. I was unable to get the grid to refresh and show new results.

Thread Participants: 2

Tags for this Thread