PDA

View Full Version : missing event ColumnMove



miwe76
30 Jul 2010, 2:07 AM
hi i wanna try the new ColumnReordering Feature on Grids...
It works but the event ColumnMove ist happening when i move a coulmn.... Is this a bug?

grid.setColumnReordering(true);

grid.addListener(Events.ColumnMove, new Listener<BaseEvent>() {
@Override
public void handleEvent(BaseEvent be) {
Log.debug("ColumnMove");
}
});

Thank u

Michael

sven
30 Jul 2010, 2:26 AM
The ColumnModel fires the event, not the grid itself:


grid.getColumnModel().addListener(Events.ColumnMove, new Listener<BaseEvent>() {
@Override
public void handleEvent(BaseEvent be) {
Log.debug("ColumnMove");
}
});

miwe76
30 Jul 2010, 2:57 AM
Thanks..

And how do i get the old and the new Columnid?

sven
30 Jul 2010, 3:25 AM
It is not possible. You only get the new index. You can extend ColumnModel and override the moveColumn method to also get the old index.