楼主你这个例子为什么没有分页是因为 你的store没有load  在你的store定义完之后要load 比如:
store.load({params:{start:0,pageSize:20}})  在给你一个json从后台获取的例子:
 var store = new Ext.data.Store({
        proxy : new Ext.data.HttpProxy({
            url :MAIN_SERVLET,
            method : 'GET'
        }),
        reader : new Ext.data.JsonReader({
            root : 'topics',
            totalProperty: 'totalCount',
            id : 'uids'
        },[
            {name : 'uids',type : 'string'},
            {name : 'pid', type : 'string'},
            {name : 'warnrulename', type : 'string'},
            {name : 'sourcedatatable',type : 'string'},
            {name : 'sourcedataitem', type : 'string'},
            {name : 'comdatatable', type : 'string'},
            {name : 'comdataitem', type : 'string'},
            {name : 'calculatetype', type : 'string'},
            {name : 'rangemin', type : 'float' },
            {name : 'rangemax', type : 'float'},
            {name : 'warnlevel',type : 'string'},
            {name : 'warnhelp', type : 'string'},
            {name : 'moduleid', type : 'string'},
            {name : 'sourcerelateitem', type : 'string'},
            {name : 'sourcehidecon', type : 'string'},
            {name : 'scalculatemode', type : 'string'},
            {name : 'comrelateitem', type : 'string'},
            {name : 'comhidecon', type : 'string'},
            {name : 'comcalculatemode', type : 'string'},
            {name : 'mid', type : 'string'}
        ]),
        baseParams : {
            ac : 'list',
            bean : 'com.sgepit.pcmis.warn.hbm.PcWarnRules',
            business :'baseMgm',
            method :'findwhereorderby',
            params : '1=1'
        }
        
    })
    var selModel = new Ext.grid.CheckboxSelectionModel({
        singleSelect :true,
        header :'',
        listeners : {
            rowselect :function (sm,index,rec){
                selectUids = rec.get('uids');
                southStore.baseParams.params = "warnrulesid ='"+selectUids+"'";
                southStoreReload();
                rangeStore.baseParams.params = "warnrulesid='"+selectUids+"'";
                rangeStoreReload();
            },
            rowdeselect : function (sm,index,rec){
                selectUids = '';
                southStore.baseParams.params = "warnrulesid ='"+selectUids+"'";
                southStoreReload();
                rangeStore.baseParams.params = "warnrulesid='"+selectUids+"'";
                rangeStoreReload();
            }
        }
    })
    var columnModel = new Ext.grid.ColumnModel([selModel,
        {
            header : '主键',
            dataIndex:'uids',
            width:20,
            hidden:true
         },{
            header : '规则名称',
            width :120,
            align : 'center',
            dataIndex : 'warnrulename'
         },{
            header :'源数据表',
            width : 60,
            align : 'center',
            dataIndex : 'sourcedatatable'
         },{
            header : '比较数据表',
            width : 60,
            align : 'center',
            dataIndex : 'comdatatable',
            renderer : function (value){
                if(value=='null'){
                    return "";
                }else {
                    return value;
                }
            }
         },{
            header : '范围最小值',
            width : 0,
            hidden : true,
            align : 'right',
            dataIndex : 'rangemin'
         },{
            header : '范围最大值',
            width : 0,
            hidden : true,
            align : 'right',
            dataIndex : 'rangemax'
         },{
            header : '预警内容说明',
            width : 0,
            hidden : true,
            dataIndex : 'warnhelp'
         }
    ]);
    var grid = new Ext.grid.GridPanel({
        title : '预警规则定义列表',
        id : 'north-grid',
        region : 'north',
        height : 300,
        width :1050,
    store: store,
    sm :selModel,
    cm: columnModel,
    iconCls: 'icon-show-all',
    border: false,
    layout: 'fit',
    header: true,
    autoScroll: true, //自动出现滚动条
        collapsible: false, //是否可折叠
        animCollapse: false, //折叠时显示动画
        loadMask: true, //加载时是否显示进度
        trackMouseOver:true,
    viewConfig: {
        forceFit: true,
        ignoreAdd: true
    },
    tbar:[
        {text: '新增',
         iconCls:'add',
         handler:opWin},'-',{
         text :'修改',
         iconCls : 'select',
         handler :modifyfunction
        },'-',{
         text : '删除',
         iconCls : 'remove',
         handler : removeRules
        },'-',{
          text : '分配责任人',
          iconCls : 'option',
          handler : distributePerson   
        }
    ],
    bbar: new Ext.PagingToolbar({//在底部工具栏上添加分页导航
            pageSize: PAGE_SIZE,
            store: store,
            displayInfo: true,
            displayMsg: ' {0} - {1} / {2}',
            emptyMsg: "无记录。"
        })
});
northReload();
function northReload(){
    store.load({params:{start : 0,limit : PAGE_SIZE}});
}

解决方案 »

  1.   

    当然  我给你的这个例子里面我们都做了写封装 只是告诉你怎么做  这个功能不是直接可以用你要看懂了就知道是怎么用了  store中的那些参数都是定义的参数希望对你有帮助
      

  2.   

    store.load({params:{start : 0,limit : pageSize}});这句忘记帖上来了,再试一次也还是没用,还是一次这把所有数据显示出来了。
    我的是ArrayReader,网上合偶尔看到些资料说不支持分页。不知是否这样,有没有ArrayReader这方面的例子。