PDA

View Full Version : Buffered Grid in EXT 4 (paginggridscroller)



dimitris
2 Nov 2011, 1:04 AM
I'm trying to create a buffered grid EXT4.0 using a simple proxy with an XML reader

However I get an error
" Uncaught Ext.Error: Unable to parse the JSON returned by the server: You're trying to decode an invalid JSON String: "

The example into your documents http://cdn.roomview.gr/spotahotel/scripts/ext-4.0.7-gpl/docs/#!/example/grid/infinite-scroll.html works fine but only with JSON?

This means that this feature works only for JSON format?

Thank you in advance

My code:


var proxy = new Ext.data.HttpProxy({
url:'./proxygrid1.php',
timeout: 60000,
method: 'post'
});
langsStore = Ext.create('Ext.data.Store', {
storeId:'langStore',
proxy: proxy,
reader: new Ext.data.XmlReader({
record:'lang'
}, [
{ name: FieldList[0], type: 'string' },
{ name: FieldList[1], type: 'string' },
{ name: FieldList[2], type: 'string' },
{ name: FieldList[3], type: 'string' }
]),
pageSize: 200,
buffered: true,
purgePageCount: 0
});
var sm = Ext.create('Ext.selection.CheckboxModel');
inGrid = Ext.create('Ext.grid.Panel', {
selModel: sm,
verticalScrollerType: 'paginggridscroller',
disableSelection: true,
invalidateScrollerOnRefresh: false,
store: langsStore,
columns: Columns,
renderTo: Ext.getBody()
});
langsStore.load({
params: {
queryId: 'getCities'
},
callback: function() {
langsStore.guaranteeRange(0,199);
}
});

mitchellsimoens
16 Nov 2011, 11:51 AM
YOu are mixing old Ext JS 3 stuff with Ext JS 4. Can you clean it up to be fully Ext JS 4 compliant?