I am using the ParamQuery JavaScript library (ParamQuery Website) to build a JavaScript grid.
With JQuery I make a request to my service using Ajax which retunrs JSON data. I then loop through my JSON data and assign it to an array. My problem is the elements are strings but I think they need to be an array of objects.
<script type="text/javascript">
$(document).ready(function () {
var DataArray = [];
$.ajax({
url: "http://wks52025:82/WcfDataService.svc/GetNotes()?$format=json",
type: "get",
datatype: "json",
success: function (data) {
$.each(data.d, function (i, item) {
DataArray[i] = "[" + item.NotesTitle.trim() + "," + item.NotesText.trim() + "]";
})
for (var i = 0; i < DataArray.length; i++) {
//alert(DataArray[i]);
//Do something
}
// GRID LOGIC HERE
var obj = { width: 800, height: 400, title: "Notes" };
obj.colModel = [
{ title: "NotesTitle", width: 500, dataType: "string" },
{ title: "NotesText", width: 500, dataType: "string" }
];
obj.dataModel = { data: DataArray }; // Data Array goes here
$("#grid_array").pqGrid(obj);
}
});
});
</script>
I have attached screenshots of my Watch tab in VS and a screenshot of how the grid renders after debug.


Can anyone help me solve this problem?