开发者

jqgrid populating data, but giving tr an ID of null

Ok, so my jqgrid is populating the data fine, and also hiding columns I need to. However now search isn't working, and, when inspecting the <tr> of each row of data, I see they all have an id of null:

http://sysport.co.uk/admin/grid/TEST.php

Now search doesn't work and export to excel only gives the same rows repeated.

Below is my code for the jqGrid:

sysport.co.uk/admin/grid/37multiple.js (Too big to post on here).

Any help would be massivel开发者_开发百科y appreciated, never got an answer on the forum.


Take a look at the response from the server. Each row does have an id of null there.


If you look at the response of the server you will see this:

{"page":"1","total":1,"records":"366","rows":[{"id":null,"cell":["4","Borough of Barnsley Swimming Club"

The ID = null. I dont know how you create the jsonstring. So look into that function and fill the 'ID' with the right value.

If the ID is the same as the ID in the first column you can do this to: Alter the settings of the jsonreader in the jqgridsettings to this:

jsonReader: { cell: "", id: "0" },
rowNum:50,
rowTotal: 2000,
rowList : [30,50,100],
...

With these settings, the jsonreader will know that the first columns is your ID column. Then you can return your jsontring in like this:

{"page":"1","total":1,"records":"366","rows":[["4","Borough of Barnsley Swimming Club"...

I don't know if this ID problem is the root of the problem for your excel and search problem. But maybe if the ID is filled in, it will work...

For more inforamation about the jsonreader, taak a look here

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜