PDA

View Full Version : Grid sorting problem - extjs 4.0



gretchen23
24 Oct 2011, 12:17 PM
Hi,

I have a grid with some data in it. If I add/remove data from it and sort on one of the columns, it sorts on the old grid data and not the changed one. For example, if I add a record x into the grid, it does show in the grid but when I attempt to sort, I dont see x anymore until I refresh the page. It looks like the sort uses cached store data. How can I get rid of this problem?

var grid = Ext.create('Ext.grid.GridPanel', {
region: 'center',
id: 'grid',
selType: 'rowmodel',
verticalScroller: {
xtype: 'paginggridscroller'
},
loadMask: true,
invalidateScrollerOnRefresh: false,
viewConfig: {
trackOver: false
},
store: store,
columns: [ ... ]
});

var store = Ext.create('Ext.data.JsonStore', {
autoDestroy: true,
storeId: 'myStore',
pageSize: 200,
buffered: true,
proxy: {
type: 'ajax',
url: '/getResults.php',
reader: {
type: 'json',
root: 'data',
idProperty: 'id',
successProperty: 'success',
totalProperty: 'totalCount'
}
},
fields: [ ... ]
});

skirtle
24 Oct 2011, 2:35 PM
Please use CODE tags when posting code (# button on the editor toolbar).

What you're trying to do should work fine. Exactly which ExtJS version are you using?

Trying simplifying the grid down a bit. Get rid of all but the absolute essentials. You should be able to reduce it down to just the columns and the store (and possibly settings relevant to rendering it correctly, like region). Likewise the store, get rid of settings like buffered. If it works with a minimal config then you can start to reintroduce the other settings until it stops working.

gretchen23
25 Oct 2011, 1:16 PM
Thanks skirtle. I am using Ext 4.0.2.

How does sorting work on infinite scrolling grid if the store does not get all the data? Can you please point me to an example of remote sorting on infinite grid if there is any?

bee
17 Nov 2011, 3:04 AM
Is this problem solved ? I am facing same problem.

PrashanthShetty
28 Dec 2011, 7:34 AM
Hi All,

Is this still the open issue, Has anyone found a solution for the same. Any help regarding the same is highly appreciated.

Thanks,
Prashanth

PrashanthShetty
1 Jan 2012, 7:59 AM
Scenario:
1.Load the bufferred Grid with some data on load of the page say 5 records. Have one Button on the bottom of the Grid.
2.Load the Grid with different data on click of the button action say some 20 records.
3.On Click of sorting on any of the header, You will see only 5 records instead of 20 records & sorting hangs after once & you will not be able to sort the data after that.


This is a basic use case, Working on EXTJS for some 3 years by now i never saw such a instable version being released to end users.


Extjs3 in IE Browser performs relatively Great in performance in Buffered Grid & EXTJS4 has lot of issues, Not sure when the fix is planned to improve the performance in IE Browser.