My ASP.NET page method is working and data is coming back but no data is being rendered in the grid. The grid just shows the column names and no rows. Here is the first row of the data returned from the invocation of my ASP.NET page method.
{"d": [{"__type":"HDServer.DataDictViewModel","IndexName":"$FacilityName","FieldWidth":8,"MaximumValue":null,"MinimumValue":null,"PointType":"VAR","ProcessArea":null,"CompressionType":"LST","DataSource":null,"DataType":"A","DecimalPlaces":2,"Description":"$FacilityName","Units":null}]
}
The javascript I am using is basically from the editing-popup grid sample
<script>
$(document).ready(function () {
var crudServiceBaseUrl = "Default.aspx",
dataSource = new kendo.data.DataSource({
transport: {
read: {
url: crudServiceBaseUrl + "/ReadDataDict",
contentType: "application/json; charset=utf-8", // tells the web service to serialize JSON
type: "POST", //use HTTP POST request as the default GET is not allowed for ASMX
dataType: "jsonp"
},
parameterMap: function (options, operation) {
if (operation !== "read" && options.models) {
return kendo.stringify({ datadict: options.models });
}
}
},
batch: true,
pageSize: 30,
schema: {
data: "d", // ASMX services return JSON in the following format { "d": <result> }. Specify how to get the result.
model: {
id: "IndexName",
fields: {
IndexName: { type: "string", nullable: false, validation: { required: true } },
FieldWidth: { type: "number", validation: { required: true } },
MaximumValue: { type: "number" },
MinimumValue: { type: "number" },
PointType: { type: "string" },
ProcessArea: { type: "string" },
CompressionType: { type: "string" },
DataSource: { type: "string" },
DataType: { type: "string", validation: { required: true } },
DecimalPlaces: { type: "number", validation: { required: true } },
Description: { type: "string", validation: { required: true } },
Units: { type: "string", validation: { required: true } }
}
}
}
});
$("#grid").kendoGrid({
dataSource: dataSource,
pageable: true,
height: 400,
toolbar: ["create", "save", "cancel"],
columns: [
{ field: "IndexName", title: "Index Name" },
{ field: "FieldWidth", title: "Field Width", width: "150px" },
{ field: "PointType", title: "Point Type", width: "150px" },
{ field: "ProcessArea", title: "Process Area", width: "100px" },
{ field: "MinimumValue", title: "Min", width: "100px" },
{ field: "MaximumValue", title: "Max", width: "100px" },
{ command: ["edit", "destroy"], title: " ", width: "210px" }],
editable: "popup"
});
});
</script>
The javascript console shows no errors and all scripts load successfully. The grid does render, but with no data. I am at a loss ...
Dan
{"d": [{"__type":"HDServer.DataDictViewModel","IndexName":"$FacilityName","FieldWidth":8,"MaximumValue":null,"MinimumValue":null,"PointType":"VAR","ProcessArea":null,"CompressionType":"LST","DataSource":null,"DataType":"A","DecimalPlaces":2,"Description":"$FacilityName","Units":null}]
}
The javascript I am using is basically from the editing-popup grid sample
<script>
$(document).ready(function () {
var crudServiceBaseUrl = "Default.aspx",
dataSource = new kendo.data.DataSource({
transport: {
read: {
url: crudServiceBaseUrl + "/ReadDataDict",
contentType: "application/json; charset=utf-8", // tells the web service to serialize JSON
type: "POST", //use HTTP POST request as the default GET is not allowed for ASMX
dataType: "jsonp"
},
parameterMap: function (options, operation) {
if (operation !== "read" && options.models) {
return kendo.stringify({ datadict: options.models });
}
}
},
batch: true,
pageSize: 30,
schema: {
data: "d", // ASMX services return JSON in the following format { "d": <result> }. Specify how to get the result.
model: {
id: "IndexName",
fields: {
IndexName: { type: "string", nullable: false, validation: { required: true } },
FieldWidth: { type: "number", validation: { required: true } },
MaximumValue: { type: "number" },
MinimumValue: { type: "number" },
PointType: { type: "string" },
ProcessArea: { type: "string" },
CompressionType: { type: "string" },
DataSource: { type: "string" },
DataType: { type: "string", validation: { required: true } },
DecimalPlaces: { type: "number", validation: { required: true } },
Description: { type: "string", validation: { required: true } },
Units: { type: "string", validation: { required: true } }
}
}
}
});
$("#grid").kendoGrid({
dataSource: dataSource,
pageable: true,
height: 400,
toolbar: ["create", "save", "cancel"],
columns: [
{ field: "IndexName", title: "Index Name" },
{ field: "FieldWidth", title: "Field Width", width: "150px" },
{ field: "PointType", title: "Point Type", width: "150px" },
{ field: "ProcessArea", title: "Process Area", width: "100px" },
{ field: "MinimumValue", title: "Min", width: "100px" },
{ field: "MaximumValue", title: "Max", width: "100px" },
{ command: ["edit", "destroy"], title: " ", width: "210px" }],
editable: "popup"
});
});
</script>
The javascript console shows no errors and all scripts load successfully. The grid does render, but with no data. I am at a loss ...
Dan