I have a grid that I have been using for a long time. Today I added the property "sortable: true". The grid now sorts correctly, but it is only one row high!
I never specify the height and I do not want to.
$("#jobMilestones").kendoGrid({
columns: [
{ field: "Name", title: "Milestone Description" },
{ title: "Users", field: "Users", template: "#=showAddUsers(JobTaskId,Name,Users)#" },
{ field: "DueDate", title: "Due Date", template: "#= displayMilestoneDate(DueDate, Complete) #" },
{ field: "Complete", title: "Status", template: "#= displayMilestoneStatus(Complete)#" },
{ field: "Notes"},
{ command: ["destroy", { text: "Email", className: "MSEmail"}], title: "", width: "300px" },
{ field: "JobTaskId", title: " ", template: "#=openMilestoneLog(JobTaskId)#" }
],
toolbar: ["create", "save", "cancel"],
sortable: true,
editable: true,
dataSource: {
schema: {
data: "d",
model: {
id: "JobTaskId",
fields: {
JobTaskId: { editable: false, nullable: true },
JobId: { editable: false, nullable: true },
Name: { validation: { required: true} },
Notes: { validation: { required: false} },
Users: { editable: false },
DueDate: { validation: { required: true }, type: "date" },
Complete: { type: "boolean", editable: true }
}
}
},
batch: true,
transport: {
create: {
url: "../WebServices/MilestonesWebservice.asmx/Create",
contentType: "application/json; charset=utf-8",
type: "POST"
},
read: {
url: "../WebServices/MilestonesWebservice.asmx/Read",
contentType: "application/json; charset=utf-8",
type: "POST"
},
update: {
url: "../WebServices/MilestonesWebservice.asmx/Update",
contentType: "application/json; charset=utf-8",
type: "POST"
},
destroy: {
url: "../WebServices/MilestonesWebservice.asmx/Delete",
contentType: "application/json; charset=utf-8",
type: "POST"
},
parameterMap: function (data, operation) {
switch (operation) {
case "read":
return JSON.stringify({ jobId: localData.currentDisplayedJobId })
break;
case "create":
return JSON.stringify({ jobTasks: data.models, jobId: localData.currentDisplayedJobId, userids: pageValues.usersOnNewMilestone, fullName: globalValues.fullName })
break;
case "destroy":
//return JSON.stringify({ jobId: localData.currentDisplayedJobId, JobTaskID: data.models[data.models.length - 1].JobTaskId, fullName: globalValues.fullName })
return JSON.stringify({ JobTasks: data.models, jobId: localData.currentDisplayedJobId, fullName: globalValues.fullName })
JobTasks
break;
case "update":
return JSON.stringify({ jobTasks: data.models, fullName: globalValues.fullName })
break;
}
}
}