Hello,
I am trying to run following code, to load data in the grid:
$(document).ready(function () {
var jsonData = ‘[{\”TotalRows\”:\”2\”},’ +
‘{\”Rows\”:[‘ +
‘{ \”COL1\”:\”MN-25343\”, \”COL2\”:\”Change to PR ~`!@#$%^&*()_+1234567890-=}{][|”:\’;?></., Changed\”},{ \”COL1\”:\”MN-25342\”, \”COL2\”:\”Gdfgfg\”}]}]’;
//jsonData = JSON.parseJSON(jsonData);
var source = {
localdata: jsonData,
datafields: [{
name: ‘COL1’,
type: ‘string’,
map: ”
}, {
name: ‘COL2’,
type: ‘string’
}],
root: ‘Rows’,
datatype: “json”
};
var dataAdapter = new $.jqx.dataAdapter(source, {
beforeLoadComplete: function (records)
{
console.log(records);
return records;
},
loadComplete: function ()
{
console.log(“loadComplete”);
}
});
$(“#jqxgrid”).jqxGrid(
{
width: 850,
source: dataAdapter,
autoheight: true,
columns: [
{ text: ‘COL1’, datafield: ‘COL1’ },
{ text: ‘COL2’, datafield: ‘COL2’ }
]
});
});
loadError() function shows following error:
SyntaxError: Expected ‘}’
The grid shows no records. Please help me solve this issue.
Thank You.