1. #1
    Sencha User
    Join Date
    Sep 2012
    Posts
    13
    Vote Rating
    0
    duleep is on a distinguished road

      0  

    Default Answered: variable set for data store using SA3

    Answered: variable set for data store using SA3


    when i try to add store data that very time come with string or object
    <script>
    <?php dataarray= echo json_encode($data_array); ?>
    </script>

    so i want to set above 'dataset' variable to store using SA 3

    when i set 'dataset' to store every time that variable get as string


    Code:
    Ext.define('test1.store.store', {
        extend: 'Ext.data.Store',
    
    
        requires: [
            'Ext.data.Field'
        ],
    
    
        constructor: function(cfg) {
            var me = this;
            cfg = cfg || {};
            me.callParent([Ext.apply({
                storeId: 'store',
                data:' dataarray'
                    }, cfg)]);
        }
    });
    i need to store data set as
    Code:
    data : dataarray

  2. Get a reference to the store and then call loadData on it.

    If you give a storeId to it called 'foo', something like this.

    Code:
    Ext.StoreMgr.lookup('foo').loadData(dataarray);

  3. #2
    Sencha - Architect Dev Team aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,445
    Vote Rating
    129
    Answers
    69
    aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold

      1  

    Default


    Get a reference to the store and then call loadData on it.

    If you give a storeId to it called 'foo', something like this.

    Code:
    Ext.StoreMgr.lookup('foo').loadData(dataarray);
    Aaron Conran
    @aconran
    Sencha Architect Development Team

Thread Participants: 1

Tags for this Thread