loadData will fire a load event without start and limit parameters, making the PagingToolbar think it is on the first page.
Instead of loadData try:
Code:
var r = store.reader.readRecords(data);
store.loadRecords(r, Ext.apply({}, store.lastOptions), true);
thanks, this works fine.
here are the other problem that I came across.
I am using the newest PagingStore v0.4 and gridFilter 0.2.8. I have problems on the paging toolbar.
Three problems I've noticed after I did filtering:
1. Page count always keeps the same as well as total records count on the paging toolbar.
2. Store shows current empty page instead of navigating to 1st page (if I filter 1 record for example)
3. if a grid already have filters, pagingstores will display all records then immediately do filtering and display filtered records. so it displays twice and causes some flickering.
I looked code
filterby and clearfilter only fires datachange event. Should it also fire 'load' event to trigger the page toolbar?
And, loadRecords only do Sort not filter. Should it do both?
loadData will fire a load event without start and limit parameters, making the PagingToolbar think it is on the first page.
Instead of loadData try:
Code:
var r = store.reader.readRecords(data);
store.loadRecords(r, Ext.apply({}, store.lastOptions), true);
Originally Posted by Condor
All the issues you found are not caused by the PagingStore, but are already part of Store.
Try adding the changes you are suggesting (they sound ok)...
hi, Condor, you are right. this is not the problem of pagingstore but the problem of store itself. I spent 1 hour to understand the code of store. it seems the creator intensionally seperate filtering from loadrecords. Do not know that is the same case in 2.2. However, I understand how pagingstore works much better. (trick is the allData)
I tried to add fire load event within filterBy. That does not work. It cause recursive error.
Finally, I found a solution. Proably, you won't like.
use the grid to listen filterupdate event, then make the pagebar.doLoad(0)
I have looked your feature request. I want to confirm one thing.
If a store has a filter running already, now the store loads new data. After your change, the data store will run applyFilter twice. First in the loadRecords, second when filterBy being called. am i right?
No, normally loadRecords wouldn't filter at all (no call to filterBy). I added the applyFilter call in there to filter the store before the bound components (grids etc.) are notified.
No, normally loadRecords wouldn't filter at all (no call to filterBy). I added the applyFilter call in there to filter the store before the bound components (grids etc.) are notified.
currently, loadRecords of store do not call filtering at all. So if a store has a filter after loadRecords, which object (is that Grid) triggered filterby function? and how can you avoid those trigger. thanks for answering my question in advanced.
Do you use some kind of filter plugin that could cause this?
I am using Ext.ux.grid.GridFilters v0.2.8
Let me ask my question again. I know store has a filter method. However, none of the methods of store are calling filter method inclunding loadRecords. So this filter method must be called by bounded object. Most likely the grid object.
Am I right?