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
});
<ul id="treeView"> <li data-uid="8f04cb75-1a2a-4c9b-95c6-4a44d963505c" data-parent="">Root <ul> <li data-uid="64ca06a9-72b3-4444-b951-f46e0378b26b" data-parent="8f04cb75-1a2a-4c9b-95c6-4a44d963505c" ">1.1 <ul </li></ul><li class="clearfix"> <a href="\#/project/#: data.Id #"> # var leadPhoto = data.parent().parent().photoFileNameForLead(data); alert("pl"); if (leadPhoto) {# <img class="team-lead" data-bind="attr: {src: photoFileNameForLead}" /> #} else {# <div class="team-lead icon-user">No Lead</div> #}# <header> ... </header> </a></li><article> <div class="resource-info"> ... </div> <div class="resource-projects"> <h3>Current Projects</h3> <ul data-bind="source: getProjectsForActiveResource" data-template="resource-details-project"></ul> # alert("new resource"); var leadPhoto = data.parent().parent().activeResource; if (leadPhoto) {# <img class="team-lead" data-bind="attr: {src: photoFileNameForLead}" /> #} else {# <div class="team-lead icon-user">No Lead</div> #}# </div> <button data-bind="click: saveActiveResource" class="save-button">Save</button></article>