为什么翻页没有效果,求指导 pagingtoolbar只是给你显示一个翻页的工具条,具体事件还得自己写 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 不是吧,我就是想瞬间加载好数据,然后翻页,和后台没什么关系,看demo也没有哪里有些翻页事件自己写啊 重新改了下,以下代码为什么会没有数据,用注释掉的部分就对了, Ext.Loader.setConfig({enabled: true});Ext.Loader.setPath('Ext.ux', '../ux/');Ext.require([ 'Ext.data.*', 'Ext.tip.QuickTipManager', 'Ext.form.*', 'Ext.ux.data.PagingMemoryProxy', 'Ext.grid.Panel']);Ext.onReady(function(){ MultiLangDemo = (function() { return { init: function() { this.setupDemo(); }, setupDemo: function() { var monthArray=new Array(); for(var i=1;i<100;i++){ monthArray[i]=i; } //monthArray=['15','2','3']; 直接用这个就对了,那么我动态添加的数组为什么就不行?? var ds = Ext.create('Ext.data.Store', { fields: ['num'], remoteSort: true, pageSize: 6, proxy: { type: 'pagingmemory', data: monthArray, reader: { type: 'array' } } }); Ext.create('Ext.grid.Panel', { renderTo: 'grid', width: 380, height: 203, title:'Month Browser', selModel: new Ext.selection.CheckboxModel, //添加checkbox列 columns:[{ text: 'Month of the year', dataIndex: 'num', width: 240 }], store: ds, bbar: Ext.create('Ext.toolbar.Paging', { pageSize: 6, store: ds, displayInfo: true }) }); // trigger the data store load ds.load(); } }; })(); MultiLangDemo.init();}); 读数据时加载分页信息。每页20条数据:grid.store.load({params:{start: 0, limit: 20}}); 没用啊,是不是我用错了 Ext.require([ 'Ext.data.*', 'Ext.grid.*']);Ext.onReady(function(){ Ext.define('Book',{ extend: 'Ext.data.Model', fields: [ {name: 'Author', mapping: 'ItemAttributes > Author'}, 'Title', 'Manufacturer', 'ProductGroup' ] }); // create the Data Store var store = Ext.create('Ext.data.Store', { model: 'Book', autoLoad: true, pageSize:5, proxy: { type: 'ajax', url: '../sheldon.xml', reader: { type: 'xml', record: 'Item', idProperty: 'ASIN', totalRecords: '@total' } } }); // create the grid var pagingToolbar=new Ext.PagingToolbar({ pageSize:5, store: store, displayInfo: true, emptyMsg: '没有数据', displayMsg: '当前显示{0}-{1}条记录 / 共{2}条记录 ', beforePageText: '第', afterPageText: '页/共{0}页' }); var grid = Ext.create('Ext.grid.Panel', { width: 540, store: store, frame:true, // loadMask:true, selModel: new Ext.selection.CheckboxModel, //添加checkbox列 columns: [ {text: "Author", flex: 1, dataIndex: 'Author', sortable: true}, {text: "Title", width: 180, dataIndex: 'Title', sortable: true}, {text: "Manufacturer", width: 115, dataIndex: 'Manufacturer', sortable: true}, {text: "Product Group", width: 100, dataIndex: 'ProductGroup', sortable: true} ], bbar: pagingToolbar, renderTo:'demo' }); grid.store.load({params:{start: 0, limit: 5}}); }); 我就是想知道,获取数据之后,如何分页显示,无论是本地还是xml,还是ajax,都可以获取到数据,但是获取后全部显示在了一页内,分页工具可以点击,但是摆设一样,那么我到底是哪里写错了?? //for(var i=1;i<100;i++){ for(var i=0;i<100;i++){ //要从0开始,要不monthArray[0]为undefined导致读取数据出错 monthArray[i]=i.toString(); } jquery 获取点击 tree 点击次数 救命啊, 加载页面,点击到其中一模块页面就出现在那块。 如何把这段循环的代码,循环出的东西放入循环出的层? JS写入COOKIES,值不能重复 如何判断一个传进来的值是否是数字 高手看过来!innerHTML 的问题! asp+javascript,困惑我很久的问题 关于结构化图象控件 如何在網站裏運行本地軟件? 能够获取客户端的硬件信息吗 Ext4 可编辑grid,编辑方式是combobox jquery load 远程文件
Ext.Loader.setConfig({enabled: true});Ext.Loader.setPath('Ext.ux', '../ux/');Ext.require([
'Ext.data.*',
'Ext.tip.QuickTipManager',
'Ext.form.*',
'Ext.ux.data.PagingMemoryProxy',
'Ext.grid.Panel'
]);Ext.onReady(function(){
MultiLangDemo = (function() {
return {
init: function() {
this.setupDemo();
},
setupDemo: function() {
var monthArray=new Array();
for(var i=1;i<100;i++){
monthArray[i]=i;
}
//monthArray=['15','2','3']; 直接用这个就对了,那么我动态添加的数组为什么就不行??
var ds = Ext.create('Ext.data.Store', {
fields: ['num'],
remoteSort: true,
pageSize: 6,
proxy: {
type: 'pagingmemory',
data: monthArray,
reader: {
type: 'array'
}
}
});
Ext.create('Ext.grid.Panel', {
renderTo: 'grid',
width: 380,
height: 203,
title:'Month Browser',
selModel: new Ext.selection.CheckboxModel, //添加checkbox列
columns:[{
text: 'Month of the year',
dataIndex: 'num',
width: 240
}],
store: ds,
bbar: Ext.create('Ext.toolbar.Paging', {
pageSize: 6,
store: ds,
displayInfo: true
})
});
// trigger the data store load
ds.load();
}
};
})();
MultiLangDemo.init();
});
每页20条数据:grid.store.load({params:{start: 0, limit: 20}});
'Ext.data.*',
'Ext.grid.*'
]);Ext.onReady(function(){
Ext.define('Book',{
extend: 'Ext.data.Model',
fields: [
{name: 'Author', mapping: 'ItemAttributes > Author'},
'Title', 'Manufacturer', 'ProductGroup'
]
}); // create the Data Store
var store = Ext.create('Ext.data.Store', {
model: 'Book',
autoLoad: true,
pageSize:5,
proxy: {
type: 'ajax',
url: '../sheldon.xml',
reader: {
type: 'xml',
record: 'Item',
idProperty: 'ASIN',
totalRecords: '@total'
}
}
});
// create the grid
var pagingToolbar=new Ext.PagingToolbar({
pageSize:5,
store: store,
displayInfo: true,
emptyMsg: '没有数据',
displayMsg: '当前显示{0}-{1}条记录 / 共{2}条记录 ',
beforePageText: '第',
afterPageText: '页/共{0}页'
});
var grid = Ext.create('Ext.grid.Panel', {
width: 540,
store: store,
frame:true,
// loadMask:true,
selModel: new Ext.selection.CheckboxModel, //添加checkbox列
columns: [
{text: "Author", flex: 1, dataIndex: 'Author', sortable: true},
{text: "Title", width: 180, dataIndex: 'Title', sortable: true},
{text: "Manufacturer", width: 115, dataIndex: 'Manufacturer', sortable: true},
{text: "Product Group", width: 100, dataIndex: 'ProductGroup', sortable: true}
],
bbar: pagingToolbar,
renderTo:'demo'
});
grid.store.load({params:{start: 0, limit: 5}});
});
for(var i=0;i<100;i++){ //要从0开始,要不monthArray[0]为undefined导致读取数据出错
monthArray[i]=i.toString();
}