jqgrid treeGrid无法读取未定义的属性'rowIndex'

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了jqgrid treeGrid无法读取未定义的属性'rowIndex'相关的知识,希望对你有一定的参考价值。

当我单击展开按钮时,我尝试使用treeGrid的本地数据。我得到提示“无法读取未定义的属性'rowIndex'”

答案
<!DOCTYPE html>

<html lang="en">

<head>
    <!-- The jQuery library is a prerequisite for all jqSuite products -->
    <script type="text/ecmascript" src="./js/jquery.min.js"></script>
    <!-- This is the javascript file of jqGrid -->
    <script type="text/ecmascript" src="./js/jquery.jqGrid.min.js"></script>
    <!-- This is the localization file of the grid controlling messages, labels, etc.
    <!-- We support more than 40 localizations -->
    <script type="text/ecmascript" src="./js/i18n/grid.locale-en.js"></script>
    <!-- A link to a jQuery UI ThemeRoller theme, more than 22 built-in and many more custom -->
    <link rel="stylesheet" type="text/css" media="screen" href="./css/jquery-ui-1.10.4.custom.min.css" />
    <!-- The link to the CSS that the grid needs -->
    <link rel="stylesheet" type="text/css" media="screen" href="./css/ui.jqgrid.css" />
    <meta charset="utf-8" />
    <title>jqTreeGrid - Load On Demand - Load all Rows at once collapsed</title>
</head>

<body>

    <table id="tree"></table>
    <div id="pager"></div>

    <script type="text/javascript"> 

        var rows = [
            {
                "category_id": "1",
                "name": "ELECTRONICS",
                "price": "0.00",
                "qty_onhand": "0",
                "color": "",
                "lft": "1",
                "rgt": "44",
                "level": "0",
                "uiicon": ""
            },
            {
                "category_id": "2",
                "name": "TELEVISIONS",
                "price": "0.00",
                "qty_onhand": "0",
                "color": "",
                "lft": "2",
                "rgt": "19",
                "level": "1",
                "uiicon": ""
            },
            {
                "category_id": "3",
                "name": "TUBE",
                "price": "0.00",
                "qty_onhand": "0",
                "color": "",
                "lft": "3",
                "rgt": "8",
                "level": "2",
                "uiicon": ""
            },
            {
                "category_id": "11",
                "name": "26 " TV",
                "price": "200.00",
                "qty_onhand": "1",
                "color": "black",
                "lft": "4",
                "rgt": "5",
                "level": "3",
                "uiicon": "ui-icon-image"
            },
            {
                "category_id": "12",
                "name": "30 " TV",
                "price": "350.00",
                "qty_onhand": "2",
                "color": "black",
                "lft": "6",
                "rgt": "7",
                "level": "3",
                "uiicon": "ui-icon-document"
            },
            {
                "category_id": "4",
                "name": "LCD",
                "price": "0.00",
                "qty_onhand": "0",
                "color": "",
                "lft": "9",
                "rgt": "12",
                "level": "2",
                "uiicon": ""
            },
            {
                "category_id": "13",
                "name": "Super-LCD 42" ",
                "price": "400.00",
                "qty_onhand": "10",
                "color": "all",
                "lft": "10",
                "rgt": "11",
                "level": "3",
                "uiicon": "ui-icon-video"
            },
            {
                "category_id": "5",
                "name": "PLASMA",
                "price": "0.00",
                "qty_onhand": "0",
                "color": "",
                "lft": "13",
                "rgt": "18",
                "level": "2",
                "uiicon": ""
            },
            {
                "category_id": "14",
                "name": "Ultra-Plasma 62" ",
                "price": "440.00",
                "qty_onhand": "2",
                "color": "silver",
                "lft": "14",
                "rgt": "15",
                "level": "3",
                "uiicon": "ui-icon-clipboard"
            },
            {
                "category_id": "15",
                "name": "Value Plasma 38" ",
                "price": "312.00",
                "qty_onhand": "0",
                "color": "silver",
                "lft": "16",
                "rgt": "17",
                "level": "3",
                "uiicon": "ui-icon-clipboard"
            },
            {
                "category_id": "6",
                "name": "PORTABLE ELECTRONICS",
                "price": "0.00",
                "qty_onhand": "0",
                "color": "",
                "lft": "20",
                "rgt": "43",
                "level": "1",
                "uiicon": ""
            },
            {
                "category_id": "7",
                "name": "MP3 PLAYERS",
                "price": "0.00",
                "qty_onhand": "0",
                "color": "",
                "lft": "21",
                "rgt": "32",
                "level": "2",
                "uiicon": ""
            },
            {
                "category_id": "8",
                "name": "FLASH",
                "price": "0.00",
                "qty_onhand": "0",
                "color": "",
                "lft": "22",
                "rgt": "29",
                "level": "3",
                "uiicon": ""
            },
            {
                "category_id": "17",
                "name": "Super-Shuffle 1gb",
                "price": "20.00",
                "qty_onhand": "11",
                "color": "all",
                "lft": "23",
                "rgt": "24",
                "level": "4",
                "uiicon": "ui-icon-note"
            },
            {
                "category_id": "21",
                "name": "5Gb Flash",
                "price": "0.00",
                "qty_onhand": "0",
                "color": "",
                "lft": "25",
                "rgt": "26",
                "level": "4",
                "uiicon": "ui-icon-comment"
            },
            {
                "category_id": "22",
                "name": "10Gb  flash ",
                "price": "0.00",
                "qty_onhand": "0",
                "color": "",
                "lft": "27",
                "rgt": "28",
                "level": "4",
                "uiicon": "ui-icon-tag"
            },
            {
                "category_id": "16",
                "name": " Power-MP3 128mb",
                "price": "123.00",
                "qty_onhand": "2",
                "color": "withe",
                "lft": "30",
                "rgt": "31",
                "level": "3",
                "uiicon": "ui-icon-signal-diag"
            },
            {
                "category_id": "9",
                "name": "CD PLAYERS",
                "price": "0.00",
                "qty_onhand": "0",
                "color": "",
                "lft": "33",
                "rgt": "38",
                "level": "2",
                "uiicon": ""
            },
            {
                "category_id": "18",
                "name": " Porta CD ",
                "price": "10.00",
                "qty_onhand": "0",
                "color": "",
                "lft": "34",
                "rgt": "35",
                "level": "3",
                "uiicon": "ui-icon-eject"
            },
            {
                "category_id": "19",
                "name": "CD To go!",
                "price": "110.00",
                "qty_onhand": "11",
                "color": "",
                "lft": "36",
                "rgt": "37",
                "level": "3",
                "uiicon": "ui-icon-power"
            },
            {
                "category_id": "10",
                "name": "2 WAY RADios",
                "price": "0.00",
            

以上是关于jqgrid treeGrid无法读取未定义的属性'rowIndex'的主要内容,如果未能解决你的问题,请参考以下文章

jQGrid TreeGrid 的内联导航 addRow 方法无法正常工作

记一次jqgrid中treegrid不显示翻页按钮

jqGrid -treeGrid 按需加载

js-jqgrid treegrid不能多选,怎么解决

如果在 jqgrid treegrid 中选择了某个级别行,如何隐藏其他级别

无法读取未定义类型错误的属性“推送”:无法读取未定义错误的属性“推送”