English 中文(简体)
ExtJS4 - Grid Store pageSize
原标题:ExtJS4 - Grid Store pageSize
  • 时间:2011-11-20 23:09:51
  •  标签:
  • extjs4

我试图将仓库的页数限制在1个。 我的电网有10个物项,而成像机制正确显示10个中有1个、2个等等,但电网仍然显示所有10个项目。 我也试图将“全部”财产归还给1个,但这仍然不可行。 任何想法?

文件中的例子并不十分有用,因为它显示了源代码,但现场审查是空的。

        var photos = new Ext.data.Store({
            model:  Photos ,
            autoLoad: true,
            pageSize: 1
        });

        var photosGrid = Ext.create( Ext.grid.Panel , {
            id:  PhotoGrid ,
            store: photos,
            columns: [
                       { text: "Filename", width: 200, dataIndex:  filename  }
                    ],
            dockedItems: [{
                xtype:  pagingtoolbar ,
                store: photos,
                dock:  bottom ,
                displayInfo: true
            }],
            region:  center ,
            border: 0,
            overCls:  row-pointer 
        });
最佳回答

顺便提一下,你的问题很可能是你把所有10件物品归还给你。 日常工作支持你实施生态控制,所有日常工作都把装在仓库上,其具体参数包括页数限制和页开始指数。 你们必须利用这些参数在后台发送一个项目。 Chers mate.

http://www.ohchr.org。

//this is the model we will be using in the store
Ext.define( Page , {
    extend:  Ext.data.Model ,
    fields: [
        {name:  id ,    type:  int },
    ]
});

var data = null;
var store = null;
Ext.Ajax.request({
    url:  someurl ,
    success: function(result){
        data = Ext.decode(result.responseText);
        store = Ext.create( Ext.data.Store , {
            autoLoad: true,
            model:  Page ,
            pageSize: 1,
            data : data,
            proxy: {
                type:  memory ,
                reader: {
                  type:  json ,
                  root:  pages //this has to be as the root from your json
                }
            }
        }); 
    }
});
问题回答

It s a problem of query in your script formatting the json. When you use extjs with pageSize, it sends queries with parameters (page & limit, i remember). In your server side script, you have to check if they exist, and if so, change your query to add a limit clause (or equivalent in other databases).





相关问题
How to use JSON without json file?

I need to use dynamically JSON with data.TreeStore. With this component, there is proxy "config", it need a path to JSON file. My problem is, i can t write Json file in my application. I would know, ...

Dynamic Model with ExtJS 4

With ExtJS 3.x, I was able to use the "fields" property of a Store, but it seems with ExtJS 4 I have to absolutely use a Model. It s fine, but in my case, it s not a static Model, and I need to define ...

TreeNode click event on ExtJs 4

I m using ExtJS 4 (beta 3) and I have a TreePanel that is my kind of navigation menu. It is something like this: Jobs Add Job List All Jobs ... ... ... (this will be made on a permission system ...

Ext.loader not enabled Missing required?

I have some problems with Extjs4 librairie. I want to use treeEditor component. Firebug error : Error : uncaught exception: Ext.Loader is not enabled, so dependencies cannot be resolved ...

how to make a "MVC Application" with extjs 4.0 beta 3?

Is there someone here who made a MVC application using EXTJS 4 BETA 3? and works fine?? please help me how?, .. I have followed step by step here .. and @Abdel Olakara help but there is still an ...

Object function has no method defer

I m try to render a progress bar in grid (Ext JS), and get this error: Object function has no method defer What is this "magical" method? What does it do? And why is it not found? Code: renderer:...

热门标签