I find myself having to define fields and columns multiple times for use in grids and data sources. It would be nice to be able to use a single structure that would work for both. The visible setting would control if the field is displayed in the grid or not.
For example:
_myColumns = [
{ field: "Position.Name", title: "Position", width: 20, type: "string", editable: true, visible: false },
{ field: "Headcount.value", title: "Headcount", width: 15, type: "string", editable: true },
{ field: "FTE.value", title: "FTE", width: 15, type: "string", editable: true },
{ field: "EmployeeName.value", title: "EmployeeName", width: 50, type: "string", editable: true },
{ field: "JobCode.value", title: "JobCode", width: 20, type: "string", editable: true },
{ field: "JobTitle.value", title: "JobTitle", width: 100, type: "string", editable: true }
]
then, this can be used in $().kendoGrid( { columns: mycolumns } ) and the data source $().kendo.data.DataSource( { fields: mycolumns } ).