-
23 Feb 2012 4:54 AM #1
Issue with PagingToolBar
Issue with PagingToolBar
Hi,
I have implemented a grid with pagination(Paging with local data).
This grid also supports self drag n drop (i.e.rows can be re-ordered using drag n drop).
This is how i have implemented it :-
This works fine.Code:notifyDrop : function(dd, e, data){ var ds = quoteLineItemGrid.store; var sm = quoteLineItemGrid.getSelectionModel(); var rows = sm.getSelections(); if(dd.getDragData(e)) { var cindex=dd.getDragData(e).rowIndex; if(typeof(cindex) != "undefined") { for(i = 0; i < rows.length; i++) { ds.remove(ds.getById(rows[i].id)); } ds.insert(cindex,data.selections); sm.clearSelections(); if(quoteLineItemGrid != null){ quoteLineItemGrid.reconfigure(ds,colModel); } } } }
Now , my question is ,
When i perform drag n drop on Page No 1, (For example I have shuffled the rows)
and then i navigate to Page No 2.
Now when I come back to page No 1,
the grid rows isnt in the way I shuffled it.
Rather its, showing me data as in its original state, when it was first rendered.
I tried assigning new store to the pagingToolbar:-
This isnt helping either.Code:var oldStore = quoteLineItemGrid.getBottomToolbar().store; var pgToolbar = quoteLineItemGrid.getBottomToolbar(); pgToolbar.unbind(oldStore); pgToolbar.bindStore(ds);
Can anyone help me.
Thanks in advance.
-SandeeshLast edited by mitchellsimoens; 23 Feb 2012 at 6:53 AM. Reason: added [CODE] tags
-
23 Feb 2012 6:56 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,624
- Vote Rating
- 434
When you page, the data in the store is removed so if you changed the index of a record it will be lost when you go back to it unless the server sends back the new index when you page to it.
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
23 Feb 2012 7:06 AM #3
But I am using PagingMemoryProxy (Paging with local data).
I dont make a server call while navigating.
How do I maintain the sequence of rows while navigating?
Thanks


Reply With Quote