使用extjs grid和Java rest服务时分页不能正常工作



我有一个extjs网格面板。它包含分页工具栏。

这是分页工具栏代码:

                xtype: 'pagingtoolbar',
            store: 'courseStoreForGrid',   // same store GridPanel is using
            pageSize: 2,
            displayInfo: true,
            displayMsg: 'Displaying topics {0} - {1} of {2}',
            emptyMsg: "No topics to display",

这是我的商店代码:

                var itemsPerPage = 2; 
                 var courseStoreForGrid= Ext.create('Ext.data.Store',{
              fields : [ 'id','name','minimumAge','maximumAge','suggestedDurationDays','tags'],
             storeId:'courseStoreForGrid',
             remoteSort:true,
             pageSize:itemsPerPage,
             sortInfo: 
             {
              field: "name",
              direction: "ASC"
            },

//自动装载:没错,代理:{类型:'rest',url: 'http://localhost:8080/WebService/iTest/course/PagingCourse.json',方法:'GET';适用范围:本;读者:{输入:'json',词根:"当然";totalProperty:"totalCount"}

        }
    });
                    courseStoreForGrid.load({params:{start:0, limit:2}});

我的数据库中总共有7条记录。当我第一次在那个网格上执行分页时,它在不工作后工作得很好。

您使用的是哪个版本的Ext-js ?

在下面的url中,您可以找到官方EXT-JS 4。x文档,包括"网格面板"one_answers"分页工具栏插件"的示例

http://docs.sencha.com/ext-js/4-1/# !/api/Ext.grid.Panel

http://docs.sencha.com/ext-js/4-1/# !/api/Ext.toolbar.Paging

最新更新