Welcome Guest, Not a member yet? Register   Sign In
JSON Data, jqGrid & CodeIgniter
#1

[eluser]Drubo[/eluser]
Hi,

My Json data is like that:

{"records":"6","page":"1","total":"1","rows":[{"id":"1","cell":["1","Profident Fund","0","10.00"]},{"id":"2","cell":["2","Town Allowance","1","20.00"]},{"id":"3","cell":["3","Shift Allowance","0","20.00"]},{"id":"4","cell":["4","PhD M.Phil","0","10.00"]},{"id":"5","cell":["5","Conveyance","0","10.00"]},{"id":"6","cell":["6","Anutoshik","1","1.00"]}]}

And I am using this jqGrid Declaration:

jQuery("#table1").jqGrid({
url: 'some_url',
sortable: true,
datatype: "json",
mtype: 'post',
sortname: 'description',
sortorder: 'asc',
viewrecords: true,
pager: '#pager1',
rowNum: 6,
rownumbers: true,
height:'auto',
width: 1100,
multiselect: false,
altRows: true,
altclass:'altRow',
rowList:[6],
hiddengrid: true,
colNames : ['','Description','Base','%'],
colModel : [
{index: 'desc_id',name: 'desc_id',editable: false,hidden: true,},
{index: 'description',name: 'Description',width: 300,sortable: true,align: 'left',editable: false,resizable: true,},
{index: 'base',name: 'Base',width: 175,sortable: false,align: 'center',editable: true,resizable: true,edittype: 'select',formatter: 'select',editoptions: {value: "0:Basic Salary;1:Salary Scale"},},
{index: 'per',name: 'Per',width: 100,sortable: false,align: 'right',editable: true,resizable: true,formatter: 'number',formatoptions: {decimalSeparator:".", thousandsSeparator: ",", decimalPlaces: 2, defaulValue: 0}}
],
caption: 'Percentage Setup'}).navGrid("#pager1",{edit: false,add: false,del: false,view: false,search: false,refresh: false});


It did not show any data in my jqGrid. Please help me with this issue.
#2

[eluser]Federico Baña[/eluser]
Hi there,

That looks like a JS error more than CI. Double-check that CI is giving you the correct JSON, and then go through jqGrid docs, sure there you can find a clue about it.
#3

[eluser]Drubo[/eluser]
It was a very complicated issue. I solve this. For buddies with the same problem

try to generate

“page”:1

instead of

“page”:“1”

in the JSON string.




Theme © iAndrew 2016 - Forum software by © MyBB