Problem I'm having is first column with commands does not sort. Is this not supported?
$("#statusGrid").kendoGrid({
dataSource: {
transport: {
read: async function (options) {
KendoData_Read(
options,
BaseAbs3ApiUrl + "api/CustomerDetail/GetCustomerStatusDetail",
{ customerId: customerId }
);
}
},
sort: [{ field: "CreatedDate", dir: "desc" }]
},
dataBound: function (e) {
$(".k-grid-addDischarge").attr("title", "Add");
$(".k-grid-editDischarge").attr("title", "Edit");
$(".k-grid-viewDischarge").attr("title", "View");
},
toolbar: kendo.template($("#statusGridToolbarTemplate").html()),
scrollable: false,
excel: {
allPages: true,
fileName: "CustomerStatus.xlsx",
proxyURL: "/save",
filterable: true
},
excelExport: absKendoAutoWidthExcelExport,
sortable: true,
pageable: absKendoGridPageableDefault,
noRecords: { template: "No records to display." },
columns: [
{
command: [
{
name: "addDischarge",
text: "",
title: "Add",
visible: function (item) { return item.CanCreateDischargeDocument },
iconClass: "fas fa-plus fa-border",
click: function (e) {
e.preventDefault(); // prevent page scroll position change
var tr = $(e.target).closest("tr");
var data = this.dataItem(tr);
var url = "/Customer/Discharge/Create/" + data.CustomerStatusChangeId;
window.open(url, "_blank");
}
},
{
name: "editDischarge",
text: "",
title: "Edit",
visible: function (item) { return item.CanEditDischargeDocument },
iconClass: "fa fa-pencil-alt fa-border",
click: function (e) {
e.preventDefault(); // prevent page scroll position change
var tr = $(e.target).closest("tr");
var data = this.dataItem(tr);
var url = "/Customer/Discharge/EditByStatusChangeId/" + data.CustomerStatusChangeId;
window.open(url, "_blank");
}
},
{
name: "viewDischarge",
text: "",
title: "View",
visible: function (item) { return item.CanViewDischargeDocument },
iconClass: "fas fa-eye fa-border",
click: function (e) {
e.preventDefault(); // prevent page scroll position change
var tr = $(e.target).closest("tr");
var data = this.dataItem(tr);
var url = BaseAbs2Url + "SSRSReports/Report.aspx?report=DischargeandTransferSummary&cuCustomerStatusChangeId=" + data.CustomerStatusChangeId;
window.open(url, "_blank");
}
}
]
, headerTemplate: "Document<br />Actions", title: "Document Actions", width: "10em", sortable: true, field: "DocumentActions"
},
{ field: "Id", hidden: true },
{ title: "Status", field: "CurrentStatusTypeName", width: "20em", sortable: true },
{ headerTemplate: "Status Change<br />Reason", title: "Status Change Reason", field: "CustomerStatusChangeReasonName", width: "20em", sortable: true },
{ headerTemplate: "Admit/Start<br />of Care Date", title: "Admit/Start of Care Date", field: "AdmitStartCareDateText", width: "12em", sortable: true, template: function (item) { return formatKDate(item.AdmitStartCareDate); } },
{ title: "Service Hold/End of Care Date", field: "ServiceHoldEndCareDateText", width: "12em", sortable: true, template: function (item) { return formatKDate(item.ServiceHoldEndCareDate); } },
{ headerTemplate: "Resumption of<br />Care Date", title: "Resumption of Care Date", field: "ResumptionCareDateText", width: "12em", sortable: true, template: function (item) { return formatKDate(item.ResumptionCareDate); } },
{ headerTemplate: "Discharged<br />Closed Date", title: "Discharged Closed Date", field: "DischaredClosedDateText", width: "12em", sortable: true, template: function (item) { return formatKDate(item.DischaredClosedDate); } },
{ headerTemplate: "Status<br />Comments", title: "Status Comments", field: "StatusChangeComment", width: "20em", sortable: true },
{ headerTemplate: "Status<br />Change Date", title: "Status Change Date", field: "CreatedDateText", width: "12em", sortable: true, template: function (item) { return formatKDate(item.CreatedDate); } },
{ headerTemplate: "Status<br />Changed By", title: "Status Changed By", field: "CreatedByName", width: "15em", sortable: true },
{ title: "Discharge/Transfer Document Status", field: "DischargeDocumentStatus", width: "12em", sortable: true }
]
});