java - jqgrid not displaying rows -


JQGrid version - 4.6 JQuery version - 1.10

Rows are shown in HTML but jqgrid rows Does not display even one attempts to add a line instead. But I did not help. I'm new to JQRD. I'm just looking at these things in my code on the basis of examples on the Internet. I am completely unable to understand what is going wrong here.

This is my jQuery code

  $ ("# tblStateTableData") jqGrid ({datatype: 'Local', width: 800, // specified width; optional callname: ['state code', 'state name', 'active y / n'], // define column name callmodel: [{name: 'Id', index: 'id', key: right, width: 100, hidden: false}, {name: 'stateNm', index: 'state nm', width: 150, hidden: false}, { Name:' Action ',' Active ', width: 100, ADDIT: "checkbox", hidden: false}], // Define column model pager:' #pager ', // Set your pager div id row: 10 , Sort name: 'id', // column according to which data can be sorted; // Optional viewer: True, // if true, displays the total number of records etc. As: "X Wi-Fi to "out-of-order" Order: "ACC" // Sort Order; Optional}); Function getCountryCode () {var countryCd = $ ('# txtCountry'). Val (); $ ("#txtCou ntryCd") Val (countryCd). If (countryCd = "!") {$ .post ("getStateTableList.html", {"countryCd": countryCd}, function (data) {data = $ .parseJSON (data), if (data.status == "success ") {Var stateTableList = data.stateTableList; $ ('# tblStateTableData') jqGrid ('setGridParam', {datatype:" jsonstring ", datastr :. stateTableList}) trigger ('reloadGrid');}}); }}  

The JSON coming back from the Java code is as follows

  "{" page ":" 1 "," records ": 7," lines "{" "Cell" ["melbourne", "y"], "id": 1}, {"cell": ["new south wales", "y"], "id": 7} {"cell "[" South Australia "," Y "]," id ": 3}, {" cell ": [" Tasmania ": [" Queensland "," Y "]," id ": 6}, {" cell " "" "," "" "," Id ": 5}, {" cell ": [" Victoria "," Y "]," id ": 4}, {" cell ": [" Western Australia "," Code>  

and here is the Java code

  JqgridModel grid = "" "," id "]," id ": 2}]," total ":" 1 "New JqgridModel (); Grid.setPage ("1"); grid.setRecords (stateListObj.size ()); grid.setTotal ("1"); List rows = new ArrayLights << (); (EppsStateMst eppsStateMst: StateListObj) {JQGridRow line = new JQGridRow (); row.setId (eppsStateMst.getId () getStateCd ().); List cells = new Arrayists; cells.add (eppsStateMst.getStateNm ()); cells.add (EppsStateMst.getActiveYn ()); row.setCell (cells); rows.add (line); } Grid.setRows (rows); JSONSerializer serializer = new JSONSerializer (); String jsonResult = serializer.exclude ("* .class"). Deeply realizing (grid); Json.addProperty ("status", "success"); Json.addProperty ("Stateless List", Jason Recipe); Return json.toString ();  


Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -