I have a list of dynamically generated columns in Kendo grid. I am using here colsList just as an example.
var colsList = ["A", "B", "C"];
for (var j = 0; j < colsList.length; j++){
var columnSchema = {
"field": colsList [j],
template: function (dataItem) {
return getTemplate(dataItem, colsList [j]);
}
};
}
var getTemplate = function (dataItem, field) {
// return tempate format;
};
When getTemplate is called, second parameter i.e. field is always passed here as the last item of colsList. I need to prepare a column template which will information about the column field associated with it. How can this be achieved ? Have tried to do this via a number of ways but have not been successful.
I am new to kendo.js and not much familiar with templates.
Is there any other way of preparing template which will help me in achieving what i want to. dataItem and associated col field are the main two requirements while preparing template as on refreshing grid datasource, some conditions need to be checked in template and column data will be filled accordingly.