jqGrid navgrid问题 [英] jqGrid navgrid problem

查看:324
本文介绍了jqGrid navgrid问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用navgrid函数进行分页.但是navGrid函数没有被调用.我试图在定义navGrid的jqgrid.js文件中放置一个警报.但是此警报也没有得到调用.

I am using the navgrid function for pagination. But the navGrid function is not getting called. I tried to put an alert in the jqgrid.js file where navGrid is defined. But this alert is also not getting called.

$("#order-list-table").jqGrid({
    autowidth: true,
    datatype : "json",
    url: "order-list.htm",
    height: '90%',
    width: '100%',
    mtype: 'POST',
    colNames: [
        jQuery.i18n.prop('columnExternalOrderID'),
        jQuery.i18n.prop('columnInternalOrderID'),
        jQuery.i18n.prop('columnState'),
        jQuery.i18n.prop('columnDate'),
        jQuery.i18n.prop('columnErrorState'),
        jQuery.i18n.prop('columnAction'),
    ],
    colModel : [
        {name: "Ext Order ID", index: "externalOrderId",jsonmap:"externalOrderId"},
        {name: "Int Order ID", index: "id", jsonmap: "id"},
        {name: "State", index: "tkOrderStateId", jsonmap: "tkOrderStateId"},
        {name: "Date", index:"timestampOrderentry", jsonmap:"timestampOrderentry"},
        {name: "Error State", index: "tkErrorStateId", jsonmap: "tkErrorStateId"},
        {name: "Action", index: "realty", jsonmap: "realty"}
    ],
    forceFit: true,
    altRows: true,
    rowNum:2,
    rowList:[1,2],
    page: 1,
    pager: '#order-list-pager',
    sortname : "Ext Order ID",
    sortorder: "desc",
    shrinkToFit: true,
    viewrecords: true,
    jsonReader : { repeatitems: false },
    onSelectRow: function(){
        alert(jQuery("#order-list-table").getGridParam('selrow'));
    },
    gridComplete: function() {
        // resize the datagrid to fit the page properly:
        $('#order-list').width('100%');
        $('#order-list').css('overflow','hidden');
        $('#order-list').children('div').width('100%');
        $('#order-list').children('div').each(function() {
            $("div", this).width('100%');
            $("table", this).width('100%');
            $("div", this).css('overflow','hidden');
            $("table", this).css('overflow','hidden');
            $("td", this).css('text-align','center');
            $(this).find('#order-list-table').width('100%');
        });
    }
});

var gwdth = $("#order-list").width();
$("#order-list-table").jqGrid().setGridWidth(gwdth);

jquery("#order-list-table").jqgrid('navGrid',
    '#order-list-pager',{edit:true,add:true,del:true});

上面是我调用的 jqGrid 函数.

推荐答案

您的错误似乎很简单:您应该将jquery替换为jQuery,将jqgrid替换为jqGrid(大写的'G' )放在代码的最后一行.以下语句应该起作用:

It seems that your error is very simple: you should replace jquery to jQuery and jqgrid to jqGrid (a capical 'G') in the last line of your code. The following statement should work:

jQuery("#order-list-table").jqGrid('navGrid',
    '#order-list-pager',{edit:true,add:true,del:true});

这篇关于jqGrid navgrid问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆