I am facing an issue with the dynamically created kendo UI grid.
When I specify the the columns array with title
and field
properties and render the grid, the grid columns do not show the specified title
instead they show the field
name. I do not want the field name to show up as it is, cause the field name itself will not make sense as a column header.
Note: This is done inside an angular controller.
This is my grid definition
<div kendo-grid="ctrl.commonGrid" options="ctrl.commonGridOptions"></div>
Here is the code that I use to generate the columns.
var columns = [];
angular.forEach(ctrl.ColumnConfig, function (col) {
var newCol ={
title: col.displayName,
field: col.mappingProperty.toCamelCase(),
}
columns.push(newCol);
});
After this I assign this to the grid columns collection
ctrl.commonGridOptions = {
columns: columns,
};
and then just use the grid dataSource data method to populate the data.
ctrl.commonGrid.dataSource.data(ctrl.TableData);
I am scratching my head since yesterday, but not able to figure out whats going wrong.
Can anyone help me out.
Thanks