Thanks to Oleg, my jqGrid now looks like this, and works fine. (my problem after the code)
var columnModel = [{ name: \'ID\', index: \'ID\', sortable: true,
The reason of your problem is the inconsistent JSON data which you use:
{
"d": {
"__type": "JqGridData",
"total": 3,
"page": 1,
"records": 24,
"rows": [
{"id": 1, "cell": ["1", "Prabir", "Shrestha"]},
{"id": 2, "cell": ["2", "Scott", "Gu"]},
{"id": 3, "cell": ["3", "Scott", "Gu"]},
{"id": 4, "cell": ["4", "Bill", "Gates"]},
{"id": 5, "cell": ["5", "Steve", "Ballmer"]},
{"id": 1, "cell": ["1", "Prabir", "Shrestha"]},
{"id": 2, "cell": ["2", "Scott", "Gu"]},
{"id": 3, "cell": ["3", "Scott", "Hanselman"]},
{"id": 4, "cell": ["4", "Bill", "Hanselman"]},
{"id": 5, "cell": ["5", "Steve", "Ballmer"]}
]
}
}
The id
filed will be used as the value of id
attribute of rows of the grid (<tr>
elements). Corresponds to HTML/XHTML specification ids must be unique on the page.