Hi guys. Trying to use jqgrid in ASP.NET web forms. I read the info at http://www.jqwidgets.com/jquery-widgets-documentation/documentation/jqxgrid/jquery-grid-extra-http-variables.htm, but I’m running into the Invalid JSON primitive error. I’m not quite sure what “formatdata” does, and I don’t see that “data” is used in the call. So could you please verify the proper format for setting the datasource?
var gridsource = { datatype: "json", datafields: [ { name: 'NoteId' }, { name: 'NoteDate' }, { name: 'Note' } ], type: 'GET', url: 'TimeClock.aspx/GetUserNotes', formatdata: function (data) { return "{'userid':'robrichard', 'month':'1', 'year':'2013'}"; } }; var dataAdapter1 = new $.jqx.dataAdapter(gridsource, { contentType: 'application/json; charset=utf-8', type: 'GET', async: false, autoBind: true, loadError: function (xhr, status, error) { alert('Error loading "' + gridsource.url + '" : ' + error); } });
Thanks!