0
    var store = Ext.create('Ext.data.JsonStore', {
        storeId:'thisstore',
        proxy: {
            type: 'ajax',
            url: 'Stores/ShowModule/showGrid.php',
            simpleSortMode: true,
            reader: {
                type: 'json',
                rootProperty: 'data',
                totalProperty: 'total'
            }
        },  
        fields: [a,b,c,d],
        autoLoad: true
    });

I am pretty newbie to extjs 6, and I got this jsonstore that would retrieve the data from the php output using proxy reader. I wonder how to print out the entire json object obtained from this jsonstore into console.log, as to verify if that's exactly the json structure I want.

Many thanks in advance.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
J.NG
  • 11
  • 1
  • You could use `Ext.encode(Ext.pluck(store.data.items, 'data'));` http://stackoverflow.com/questions/2526764/how-to-retrieve-json-data-array-from-extjs-store – pagep Sep 27 '16 at 06:46

2 Answers2

0

In ExtJS 6 , after the store is loaded , you can print records in the console as :

console.log(store.getData());
Saloo
  • 816
  • 6
  • 13
0

Use Listeners in Store Config

    var store = Ext.create('Ext.data.JsonStore', {
    storeId:'thisstore',
    fields: [a,b,c,d],
    autoLoad: true,
    config : {
    proxy: {
        type: 'ajax',
        url: 'Stores/ShowModule/showGrid.php',
        simpleSortMode: true,
        reader: {
            type: 'json',
            rootProperty: 'data',
            totalProperty: 'total'
        }
    },
    listeners:{
       load:function(store){
          console.log(store.getData());
       }
    }
    }  
});
Ajay Thakur
  • 1,066
  • 7
  • 23