I've done a sequencing drag and drop grid before. I had a sequence column on the database and so simply included it in my model definition.
Then in the gridview's drop
event handler, I called record.set('sequence', newSequence)
on all effected records whenever a drop was performed. (I say "all effected records" because whenever you change the sequence of one record it doesn't only effect the sequence of that one record e.g.: if you move a record from the very bottom of the grid to the very top all of record sequence numbers after the dropped record will be increased by one, they will all be dirty and need to be updated on the database).
Using record.set
will then show that the record's sequence column is dirty with a flag.
You said that you have the server side updating ok so I am assuming that you are performing this resequencing logic on the server side, you would have to move it back onto the JS, I don't know if you want to do that.
index
property? I believe it is the property that changes when you reorder things, and if defined in the model the model record should become dirty upon drag-drop (works for trees anyway). – IzhakiDragDrop
plugin ondrop
Event and there you can process all the order-related changes (send new position to server and so on). – s.webbandit{name: 'index', type: 'int'}
to your model - it might do the trick. By defining it, ExtJS will monitor changes to it and will mark any record as dirty when you re-order your records (again, this is how trees work, which I assume is the same for grids). – Izhaki