extjs - moving rows up and down on ext grid using ext4 -
i'm trying enable allowing rows moved , down using buttons on ext grid using ext 4.
here's snippit of code moving row up:
var record = grid.getselectionmodel().selection.record; var index = grid.getstore().indexof(record); var newindex = index - 1; this.store.remove(selection, true); this.store.insert(newindex, record); //selectionmodel.select(record);
when move once, it's correct , row moves , stays highlighted. when move again, row moves , becomes unhighlighted , deselected.
i tried selecting record on last line of code commented out, line of code ends highlighting row below moved row while keeping moved row highlighted.
i want able continually press button , move selected row without having reselect manually.
it might lot easier add field store/model ranks records. way have change rank-number , filter store. should keep selection intact. if don't want rank-field synced proxy, set "persist" property false on field. that's anyway better using private parameters on remove method.
Comments
Post a Comment