ventryj
28 Jun 2015, 6:01 AM
Hello,
I am trying to make a simple change of updating a column's header text and menu text based on user input. I am able to update the header text by using the column's setText() method, and it is working fine. However, setText() does not seem to update the menu text for that column in the header show/hide menu. I tried to manually change the menuText for the column, but it did not seem to work. Is there a known way to update a columns menuText dynamically?
52749
var fields = this.getMyStoreStore(),
grid = Ext.ComponentQuery.query('#mygrid')[0],
columns = grid.columns,
change = false,
column;
fields.load(function(records, operation, success) {
if(records.length > 0) {
for(var i = 0; i < columns.length; i++) {
column = columns[i];
customField = fields.findRecord('DataIndex', column.dataIndex);
if(customField) {
column.setText(customField.get('FieldName'));
column.menuText = customField.get('FieldName');
change = true;
}
}
}
return callback(change, columns);
});
Thanks!
Joey
I am trying to make a simple change of updating a column's header text and menu text based on user input. I am able to update the header text by using the column's setText() method, and it is working fine. However, setText() does not seem to update the menu text for that column in the header show/hide menu. I tried to manually change the menuText for the column, but it did not seem to work. Is there a known way to update a columns menuText dynamically?
52749
var fields = this.getMyStoreStore(),
grid = Ext.ComponentQuery.query('#mygrid')[0],
columns = grid.columns,
change = false,
column;
fields.load(function(records, operation, success) {
if(records.length > 0) {
for(var i = 0; i < columns.length; i++) {
column = columns[i];
customField = fields.findRecord('DataIndex', column.dataIndex);
if(customField) {
column.setText(customField.get('FieldName'));
column.menuText = customField.get('FieldName');
change = true;
}
}
}
return callback(change, columns);
});
Thanks!
Joey