Hi I'm using the kendo grid control, i can get the columns to display and if i enter the data using the following method :
The data will display too, however i am trying to populate the grid from an array and thus am using this method:
My data however will not appear i just get the column headings, please find my code below:
var Container = document.getElementById("divReportContainer");
Container.innerHTML = "";
OutputText += "<table id=\"grid\">";
OutputText += "<thead>";
OutputText += "<th data-field=\"strObjectDescription\">Object Description</th>";
OutputText += "<th data-field=\"dblPercentageLength\">% of Total Actual Length</th>";
OutputText += "<th data-field=\"dblActualLength\">Total Actual Length(ft)</th>";
OutputText += "<th data-field=\"intPlanogramsCount\">Count of Planograms</th>";
OutputText += "</thead>";
OutputText += "</table>"
Container.innerHTML = OutputText;
$("#grid").kendoGrid();
var MyArray = [{ strObjectDescription: "Test", dblPercentageLength: "1", dblActualLength: "21", intPlanogramsCount: "3"}];
$("#grid").kendoGrid({
data: MyArray
});
please could someone advise where i am going wrong???
$(document).ready(function(){
$("#grid").kendoGrid({
columns:[
{
field: "FirstName",
title: "First Name"
},
{
field: "LastName",
title: "Last Name"
}],
dataSource: {
data: [
{
FirstName: "Joe",
LastName: "Smith"
},
{
FirstName: "Jane",
LastName: "Smith"
}]
}
});
});
The data will display too, however i am trying to populate the grid from an array and thus am using this method:
$("#grid").kendoGrid({
data: people
});
My data however will not appear i just get the column headings, please find my code below:
var Container = document.getElementById("divReportContainer");
Container.innerHTML = "";
OutputText += "<table id=\"grid\">";
OutputText += "<thead>";
OutputText += "<th data-field=\"strObjectDescription\">Object Description</th>";
OutputText += "<th data-field=\"dblPercentageLength\">% of Total Actual Length</th>";
OutputText += "<th data-field=\"dblActualLength\">Total Actual Length(ft)</th>";
OutputText += "<th data-field=\"intPlanogramsCount\">Count of Planograms</th>";
OutputText += "</thead>";
OutputText += "</table>"
Container.innerHTML = OutputText;
$("#grid").kendoGrid();
var MyArray = [{ strObjectDescription: "Test", dblPercentageLength: "1", dblActualLength: "21", intPlanogramsCount: "3"}];
$("#grid").kendoGrid({
data: MyArray
});
please could someone advise where i am going wrong???