javascript - jqGrid not filling with data? -
I have installed jqGrid to display my data, even if the data is coming from the server, in the data grid Is not displayed. This is the server response.
Here's the JavaScript.
& lt; Table id = "grid1" class = "scroll" & gt; & Lt; / Table & gt; & Lt; Div id = "pager" class = "scroll" style = "text-align: center;" & Gt;
& lt; Script & gt; $ (Document) .ready (function () {jQuery ("# Grid1") .jqGrid ({url: 'api / matchingservice / webpage / getuser', datatype: 'jason', mitip: 'get', callname: ['Id', 'account', 'ref', 'bidet'], callmodel: [{name: 'id', index: 'id', width: 200}, {name: 'account', index: 'account ', Width: 300}, {name:' referee ', index:' ref ', width: 300}, {name:' bidit ', index:' bidit ', width: 300}], line number: 10, row List: [10, 20 (pager: 'pager', pager: '# pager', sort name: 'id', view graph: true, sequential Navigrade (pager, {edit: del: true, refresh: true, search: true});}); JSON format of data below but data is not loading Am i doing wrong
As stated in the comment by Mustafa; Txominpelu Try formatting your JSON result:
{"Total": 1123, "Page": 1, "Record": 1123, "Lines": [{"id": 1174 , "Cell": ["1174", "4", "", ...]}]} and on server side
public Execution GridData (Int page, int rows, string searchfilld = "", string search string = "", string searchopher = "", string sidx = "MY_ID", string sound = "ds") {// ... var jsonData = New {total = total pages, pages, records = total vacancies, rows = (items in items.) Select CHI () New {id = item. MI_ID, cell = new [] {# field item ToSafeString (item.MY_ID), ToSafeString (item ShiftID), // ... #endregion}}). ToArray ()}; }
Comments
Post a Comment