Here is my code in the aspx page. It is getting to it as I can see in the log file that it gets the JSON data and I validated it.
string jsonString = new JavaScriptSerializer().Serialize(fields);
mlog.Info("Here is the JSON String ==> " + jsonString);
Request.ContentType = "application/json; charset=utf-8";
Response.Write(jsonString);
Here is the code to call the datagrid:
var frozenColumns = "[[{field:'MappingFieldID',title:'MappingFieldID',width:100,align:'center'},{field:'Field',title:'Field',width:100,align:'left'}]]";
var columns = "[[{field:'Screen',title:'Screen',width:80,align:'center'},{field:'ErrorMessage',title:'ErrorMessage',width:160,align:'left'},{field:'IsRequired',title:'Is Required',width:100,align:'center'},{field:'TableName',title:'Table',width:80,align:'center'},{field:'ValueType',title:'Value Type',width:80,align:'center'},{field:'FieldId',title:'Field Id',width:100,align:'center'},{field:'Description',title:'Description',width:140,align:'left'},{field:'Schedule',title:'Schedule',width:140,align:'center'},{field:'EditChecks',title:'Edit Checks',width:140,align:'center'},{field:'FieldCalculations',title:'Field Calculations',width:140,align:'center'}]]";
$(function()
{
$('#GridTable').datagrid({
width: 600,
height: 350,
nowrap: true,
striped: true,
collapsible: false,
url: 'GetJSONData.aspx',
//sortName: 'Field',
//sortOrder: 'asc',
idField: 'MappingFieldID',
fitColumns: false,
frozenColumns: eval(frozenColumns),
columns: eval(columns),
pagination: false,
rownumbers: false
});
});
It loads the table but only the table columns and it shows the "processing while loading" then it stops and I don't know what happens..
Any ideas if this is the correct way to load the JSON data from a .net page?
I also have another way using a webmethod to get the JSON data but how if I have the JSON data could I load it into the datagrid??
Any help either way would be great!!
Thanks,
Jim