1. #1

    Join Date
    Aug 2012
    Posts
    3
    Vote Rating
    0
    abondili is on a distinguished road

      0  

    Default Unanswered: How to load json object into store dynamically and update grid?

    Unanswered: How to load json object into store dynamically and update grid?


    I have a grid which is supposed to be updated by the remote JSON object data into the grid's store and display it. I have the written like this below but it is not working well...

    Code:
    var myStore = Ext.data.StoreManager.get("driveScheduleStore");
    var tempStore = Ext.data.StoreManager.get("tempDSStore");
    var grid = Ext.getCmp('driveScheduleGridPanel');
    
    var strSearch = Ext.getCmp('TeamNumSearch').getValue();
    Ext.Ajax.request({
        url: '.../TEST/GetDriveScheduleDataFilter.php',    
        method: 'POST',
        params:{teamnum:newValue},
        success: function(result, request) {
            var json = result.responseText;
            var temp = JSON.parse(json);
            
            //myStore.loadData(temp.SCHEDULE);
            grid.getStore().loadData(temp.SCHEDULE);
            Ext.Msg.alert('Message',temp.SCHEDULE.length);
            
            //Ext.Msg.alert('Message',temp.SCHEDULE);
            //myStore.load();
            
        },failure: function(result, request) {
            Ext.Msg.alert('Error', 'An Error occured...');
        } 
    });

  2. #2
    Sencha User carol.ext's Avatar
    Join Date
    Jun 2007
    Location
    Littleton, Colorado, USA
    Posts
    698
    Vote Rating
    28
    Answers
    24
    carol.ext has a spectacular aura about carol.ext has a spectacular aura about

      0  

    Default


    What do you mean by not working well? What result do you get? Is there a good reason why you are not having the store load its own data?

    Quote Originally Posted by abondili View Post
    I have a grid which is supposed to be updated by the remote JSON object data into the grid's store and display it. I have the written like this below but it is not working well...