View Full Version : Restful store: changing order of records

1 Oct 2010, 7:57 AM

I'm working on a web-application that uses a RESTful store based on this (http://dev.sencha.com/deploy/dev/examples/restful/restful.html) example to render a restful grid.

Everything works fines, but now I have to implement a re-order action on a subset of records. I didn't find a better way to implement this action than to just remove the affected records from the store and than inserting them again in the right order. The problem with this approach is that all the remove/insert actions on the store result in a bunch of DELETE/PUT requests to the server, which is not what I had in mind since it seems like a bit of overkill, but there may be no other way?

I've tried to put store.suspendEvents() - store.resumeEvents() around the re-order code, which does suppress the DELETE/PUT requests to the server, but then my Grid is out of sync (records are still in the previous order). Is there a way to force the Grid to synchronize its state with the store?

Thanks in advance!