jqGrid - cant select rows - Cannot call method 'indexOf' of undefined

后端 未结 1 592
被撕碎了的回忆
被撕碎了的回忆 2020-12-21 01:42

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,          


        
相关标签:
1条回答
  • 2020-12-21 02:24

    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.

    0 讨论(0)
提交回复
热议问题