Our blazing fast Grid component built with pure JavaScript
I can change the text of a column dynamically, but what do I do to refresh the column header?
e.g. this doesn't refresh it:
grid.columns.data[2].text='wow';
grid.renderContents();
grid.store.loadPage(grid.store.currentPage);
Last edited by
gregc on Sun Mar 14, 2021 7:35 pm, edited 1 time in total.
How do you mean refresh a column header? What are you trying to achieve other than changing the column text?
Just trying to change the label without having to reload the whole page.
Just do:
grid.columns.first.text = 'foo'
ok. what is the dot notation to reference it by fieldname or by nbr i.e. nth column
my guessing is not right
window.genericgrid.columns.category2.text='wow';
window.genericgrid.columns.get('category2').text='wow';
"columns" is a regular store, so use the id of your column:
grid.columns.getById('mycolumn').text='wow';
Ahh gotcha, that works, awesome !