tags:

views:

453

answers:

2

Hi there

I m trying to load a json store using a MemoryProxy ( i need to use a proxy because I use different sources depending on scenarios) it kinda looks like this

var data = Ext.decode(gridArrayData);
var proxy = new Ext.data.MemoryProxy(data);

 var store = new Ext.data.GroupingStore({               
            proxy: proxy
        });
store.load();

however when I inspect this I can see that the proxy has 10 rows of data, but not the store I m lost as to why Any pointers?

A: 

Silly question, but are you actually loading the store (via the autoload config or store.load)?

bmoeskau
yes ( i ll edit the question)
Miau
A: 

so I was missing the Arrayreader I modified the arrray example that comes with extjs replacing the arrayStore with the following

 var nameRecord = Ext.data.Record.create([                            
      {name: 'company'},
       {name: 'price', type: 'float'},
       {name: 'change', type: 'float'},
       {name: 'pctChange', type: 'float'},
       {name: 'lastChange', type: 'date', dateFormat: 'n/j h:ia'}
]);

var arrayReader = new Ext.data.ArrayReader({}, nameRecord);          

 var memoryProxy  = new Ext.data.MemoryProxy(myData);              

 var storeDos = new Ext.data.Store({                                    
     reader : arrayReader,
     autoLoad: true,
     proxy  : memoryProxy
 });

I was thinking of putting this working copy somewhere in github, as I couldnt find anything with a memory proxy working

Miau