PDA

View Full Version : [SOLVED] EditorGridPanel-set same value for all selected rows after editing a field



msinn
10 Jan 2011, 4:13 AM
Hello everybody,

I have an EditorGridPanel with RowSelectionModel with singleSelect: false.
I have to select multiple rows and then to edit a random field of one of the selected rows. After editing that value should be set to all fields of the same column of all selected rows.

Would you be nice to give me some hints, how to achieve this goal?

Thank you
Marius

msinn
10 Jan 2011, 5:29 AM
I found a solution :)

I have to add this code to the grid listener afteredit:



afteredit: function(e){
var sel = e.grid.getSelectionModel();
if(sel.getCount() > 0){
sel.each(function(rec){
if(sel.isIdSelected(rec.data.IPS_ID)){
rec.set('PLANED_DATE', e.value);
}
});
}


maybe there is a better way and I'll be very happy if you'll share a hint