RowId没有在jqGrid中获取SET

时间:2014-07-21 09:28:51

标签: javascript jquery jqgrid

我有一个jQGrid,其中rowId <tr id=''>设置为空白。 我想将rowNum设置为tr的id 请让我知道我在这里缺少什么。 我的代码是:

        var strFieldNames = new Array('Order ID', 'Debt Type', 'Member Name', 'Welfare Status', 'Accrual Effective Date', 'Obligation Accrued', 'Interest Period', 'Interest Accrued');
        var strFieldValues = new Array('orderId', 'debtType', 'name', 'currentWelfareStatus', 'accrualEffDt', 'oblAccrued', 'interestPeriod','interestAccrued');
        $('#grid0').jqGrid('GridUnload');
        selectedDynaListNum=0
        $("#grid0").jqGrid({
         datatype: "local",
        data: getMyResponseObj(),

        colNames:[strFieldNames[0], strFieldNames[1], strFieldNames[2], strFieldNames[3], strFieldNames[4], strFieldNames[5], strFieldNames[6], strFieldNames[7]],
        colMandReq:['-1','-1','-1','-1','-1','-1','-1','-1'],
        colModel:[ 

            {name:strFieldValues[0], index:strFieldValues[0], editable:false, readonly:true, width:100,
                    hidden:false,sortable:false}, 

            {name:strFieldValues[1], index:strFieldValues[1], editable:false, readonly:true, width:100,
                    hidden:false,sortable:false}, 

            {name:strFieldValues[2], index:strFieldValues[2], editable:false, readonly:true, width:90,
                    hidden:false,sortable:false}, 

            {name:strFieldValues[3], index:strFieldValues[3], editable:false, readonly:true, width:90,
                    hidden:false,sortable:false}, 

            {name:strFieldValues[4], index:strFieldValues[4], editable:false, readonly:true, width:100,
                    hidden:false,sortable:false}, 

            {name:strFieldValues[5], index:strFieldValues[5], editable:false, readonly:true, width:100,
                    hidden:false,sortable:false}, 

            {name:strFieldValues[6], index:strFieldValues[6], editable:false, readonly:true, width:100,
                    hidden:false,sortable:false}, 

            {name:strFieldValues[7], index:strFieldValues[7], editable:false, readonly:true, width:100,
                    hidden:false,sortable:false},
        ],

           loadComplete: function() 
                    {

                        jQuery('.ui-jqgrid-hbox').removeClass('ui-jqgrid-hbox').addClass('ui-jqgrid');
                        var grid0 = jQuery("#grid0");
                        var allDropDownElements = getAllDropDownElements0(); 
                        var allDropDownElementRefTables = getAllDropDownElementRefTables0();
                        processAjaxDynaTableFromReferenceTable(grid0, allDropDownElements, allDropDownElementRefTables, 0, getMyResponseObj(), refTableDataJSON);

                    },
                gridComplete:function() 
                {
                },
                   onSelectRow: function(id) 
                   {

                        },

                pager: '#pager0',
                 rowList: [6,10,20,40,60,80,100],
                gridview: true,
                rownumbers: false,
                autoencode: true,
                shrinkToFit: true,
                autowidth: true,
                sortable: false,
                height: '100%',
                rowNum: 100,
                caption:""

                });

1 个答案:

答案 0 :(得分:1)

问题是,提供给jQgrid的jsonArray中的jsonObject有一个 rowId 列,其值为0.

所以这就是上述问题的原因