angularjs - Update contents of column header in slickgrid -
i using slickgrid in angular application supports multiple languages. how can update column headers when selected language changed. column definition looks , want grid call myi18n again update column title.
{ id: "myid", name: myi18nfn('idkey'), field: "myid", width: 100}
i have angular event detects changes , have access grid object there, not sure on need make update column header
you need update coldef.name
property when language changes , trigger grid rebuild header row (which occurs in createcolumnheaders
method in slickgrid source). easiest way update column list setcolumns
call, triggers rerender of entire grid:
function updatecolumnheaders() { var cols = grid.getcolumns(); for(var = 0, il = cols.length; < il; i++) { cols[i].name = myi18nfn(cols[i].id); } grid.setcolumns(cols); }
Comments
Post a Comment