EXT gridpanel添加输入框输入显示的记录条数
时间:2011-05-18
来源:互联网
这是我网上下载的不全 希望用过的帮忙给一个参考 谢谢
先定义个显示条数的下拉框
var combo = new Ext.form.ComboBox({
name : 'perpage',
width: 40,
store: new Ext.data.ArrayStore({
fields: ['id'],
data : [ ['15'], ['25'],['50'] ]
}),
mode : 'local',
value: '15',
listWidth : 40,
triggerAction : 'all',
displayField : 'id',
valueField : 'id',
editable : false,
forceSelection: true
});
combo.on({
scope: this,
select: this.onPageSizeComboSelect
});
分页的pagingBar
this.pagingBar = new Ext.PagingToolbar({
pageSize: this.pageSize,
store: this.store,
displayInfo: true,
displayMsg: 'Displaying records {0} - {1} of {2}',
emptyMsg: "No records to display",
items: [
'-',
'Per Page',combo]
});
最后在你的grid里直接调用
bbar:this.pagingBar
先定义个显示条数的下拉框
var combo = new Ext.form.ComboBox({
name : 'perpage',
width: 40,
store: new Ext.data.ArrayStore({
fields: ['id'],
data : [ ['15'], ['25'],['50'] ]
}),
mode : 'local',
value: '15',
listWidth : 40,
triggerAction : 'all',
displayField : 'id',
valueField : 'id',
editable : false,
forceSelection: true
});
combo.on({
scope: this,
select: this.onPageSizeComboSelect
});
分页的pagingBar
this.pagingBar = new Ext.PagingToolbar({
pageSize: this.pageSize,
store: this.store,
displayInfo: true,
displayMsg: 'Displaying records {0} - {1} of {2}',
emptyMsg: "No records to display",
items: [
'-',
'Per Page',combo]
});
最后在你的grid里直接调用
bbar:this.pagingBar
作者: Java7z 发布时间: 2011-05-18
JScript code
当你选中多少页时 combo.on("select", function(comboBox) { bbar.pageSize = parseInt(combo.getValue()); store.reload({ params: { start: 0, limit: bbar.pageSize } }); });
作者: zoujp_xyz 发布时间: 2011-05-18
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28