PDA

View Full Version : Grid panel with store - navigate to previous page



Yogalakshmi
26 Mar 2014, 11:41 PM
How to navigate to previous page in grid panel without using store load/loadpage?

scottmartin
27 Mar 2014, 2:52 PM
Can you be more specific? Are you looking for a control to perform this?
http://docs.sencha.com/extjs/4.2.2/#!/api/Ext.toolbar.Paging

Yogalakshmi
28 Mar 2014, 1:06 AM
this.getAllData().removeAll(this.getRemovedRecords());
var dataCount = this.data.getCount();
if (dataCount === 0 && this.currentPage !== 1) {
this.loadPage(this.getPageCount() - 1);
}

My application uses the above code to navigate to previous page of grid with a store. I want a replacement to "this.loadPage(this.getPageCount() - 1);" which does not use load/loadPage methods.

scottmartin
28 Mar 2014, 3:49 AM
You can simply issue an ajax request to has start/limit params and the server can send back only the needed records.

Yogalakshmi
3 Apr 2014, 10:25 PM
Records in store of my application are not from servers but are entered by user. Currently, in my application when a record is deleted on the 2nd page, the control takes user to 1st page but the very first record on the 1st page of grid is not visible. However, the record is present in the store. Using, delay : 10, solves the issue now. But, creates other issues. So, I want a fix, that will avoid loading of the pages to navigate from one page to the other.