I have a JSON object that I get back from a Web Service that is a collection of 8 fields. I only want to show 4 of them in my grid. If I don't put the fields in the columns list then it doesn't show the column headers (as expected) but it still shows the columns. I have tried defining schema / model / fields to see if that would help (basically leaving those columns out), it didn't.
Right now I am using JavaScript to hide the columns but is there a better way to do this? For instance, is there a property which only maps what is defined as a column?
Thanks,
Peter
// initialize the grid, if it hasn't already been initialized
if ($("#JobPostingsGrid").html().length < 1) {
$("#JobPostingsGrid").kendoGrid({
columns: [
{ field: "OpeningNum", title: "#", width: 80 },
{ field: "Title" },
{ field: "Recruiter" },
{ field: "Location" }],
height: 600,
scrollable: true,
sortable: true,
dataSource: {
data: postings,
},
rowTemplate: kendo.template($("#JobPostingsRowTemplate").html()),
selectable: "row"
});
}
Right now I am using JavaScript to hide the columns but is there a better way to do this? For instance, is there a property which only maps what is defined as a column?
Thanks,
Peter
// initialize the grid, if it hasn't already been initialized
if ($("#JobPostingsGrid").html().length < 1) {
$("#JobPostingsGrid").kendoGrid({
columns: [
{ field: "OpeningNum", title: "#", width: 80 },
{ field: "Title" },
{ field: "Recruiter" },
{ field: "Location" }],
height: 600,
scrollable: true,
sortable: true,
dataSource: {
data: postings,
},
rowTemplate: kendo.template($("#JobPostingsRowTemplate").html()),
selectable: "row"
});
}