jqgrid 加載時第一頁面只顯示多少條數據


function initGrid() {
        localGrid = jQuery("#tbList");
        localGrid.jqGrid({
            data: localData,
            datatype: "local",
            gridview: true,
            height: 300,
            width: '90%',
            rowList: [5,10],
            colNames: innerColumns,
            autowidth: true,
            hoverrows: false,
            multiselect: false,
            colModel: [
             { name: 'Id', index: 'Id', width: 100, hidden: true },
             { name: 'Status', index: 'Status', width: 100 },
            { name: 'GroupName', index: 'GroupName', width: 200 },
            { name: 'LetterNumber', index: 'LetterNumber', width: 80, align: "center" },
            { name: 'ApplyUnitName', index: 'ApplyUnitName', width: 80, align: "center" },
            { name: 'StayDays', index: 'StayDays', width: 80, align: "center" },
            { name: 'LeaderName', index: 'LeaderName', width: 80, align: "center" }
            
            ],
            emptyrecords: "沒有任何數據",
            pager: "#pager",
            viewrecords: true,
            rownumbers: true,
            loadonce: true,
            grouping: true,
            rowNum:5,
            groupingView : {  
                groupField: ['Status']
            },
            ondblClickRow: function (id) {
                //editInfo(id);
            },
            caption: "團組信息"
            
        }).navGrid('#pager', { edit: false, add: false, del: false, searchtext: "搜索" }, {}, {}, {}, { search: true, sopt: ['cn', 'eq', 'ge', 'gt', 'le', 'lt'] });

    }

  加載時只顯示5條數據, 就是通過 rowNum:5 這一屬性實現的,當然此時你最好也將 rowList 的最少值設為 5   我這里是rowList :[5,10]

 

 

打個廣告:如果你或你朋友需求微信投票點贊的可以給我留言


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM