or
Here is setDataSource that breaks sortable columns:
$(
"#dvTargetGrid"
).data(
"kendoGrid"
).setDataSource(wwit.targets.getDataSource());
Here is the grid:
try { $("#dvTargetGrid").data("kendoGrid").destroy(); }
catch (e) { }
$("#dvTargetGrid").empty();
$("#dvTargetGrid").kendoGrid({
columns: [
{ field: "Year", title: "Year", width: 45 },
{ field: "Month", title: "Month", width: 50 },
{ field: "TargetType", title: "Target Type" },
{ field: "MeasurementType", title: "Measure", width: 70 },
{ field: "Target", title: "Target" },
{ field: "TargetItem", title: "TargetItem" },
{ command: {
name: "EditT", text: "Edit",
click: wwit.targets.editTarget,
imageClass: "k-edit",
className: "k-grid-edit",
iconClass: "k-icon"
}, width: 85
},
{ command: {
name: "DeleteT", text: "Delete",
click: wwit.targets.deleteTarget,
imageClass: "k-delete",
className: "k-grid-delete",
iconClass: "k-icon"
}, width: 90
}],
sortable: true
});