I can change the column heading in this way when I click on the row.
,rowClick: function( event, ui ) {
ui.column.title='New Header-1';
grid.refreshHeader();
}
Can I do something like this?
,rowClick: function( event, ui ) {
ui.column['Header-1'].title='New Header-1';
ui.column['Header-2'].title='New Header-2';
ui.column['Header-3'].title='New Header-3';
ui.column['Header-4'].title='New Header-4';
grid.refreshHeader();
}
Actually, what I want to do is exactly as follows.
,rowClick: function( event, ui ) {
if (ui.column.dataIndx=='Header-1') {ui.column.title='New Header-1';}
if (ui.column.dataIndx=='Header-2') {ui.column.title='New Header-2';}
if (ui.column.dataIndx=='Header-3') {ui.column.title='New Header-3';}
if (ui.column.dataIndx=='Header-4') {ui.column.title='New Header-4';}
grid.refreshHeader();
}
That's the change I want. But I have to define all the fields.
,rowClick: function( event, ui ) {
var colModelNew = [{title: 'ID','dataIndx':'ID'},{title: 'New Header-1','dataIndx':'Data1'},{title: 'New Header-2','dataIndx':'Data2'},{title: 'New Header-3','dataIndx':'Data3'},{title: 'New Header-4','dataIndx':'Data4'},{title: 'Other Header-1','dataIndx':'Data5'},{title: 'Other Header-2','dataIndx':'Data6'}]
grid.option('colModel', colModelNew);
grid.refreshCM();
grid.refresh();
}