GridPanel 分页问题.Ext 大侠 救命啊~~~~帮顶有分
问题是这样的,GridPanel 能取到所有的值。但是分页无效。可以翻页。但是翻页数据无任何变化。都是所有数据。
mystore.load({ params: { start: 0, limit: 10} }); ←个人理解这句应该是加载的时候只加载部分数据吧?
还有PagingToolbar 的 pageSize 也设置了,就是控制不住...囧啊..各位大侠谁知道原因,告诉一声谢谢。
下面是代码
mystore.load({ params: { start: 0, limit: 10} }); ←个人理解这句应该是加载的时候只加载部分数据吧?
还有PagingToolbar 的 pageSize 也设置了,就是控制不住...囧啊..各位大侠谁知道原因,告诉一声谢谢。
下面是代码
Ext.onReady(function () {
Ext.QuickTips.init();
//Ext.state.Manager.setProvider(new Ext.state.CookieProvider());
//设置代理数据
var proxy = new Ext.data.HttpProxy({
url: '/action/S_MediaData.aspx',
method: 'GET'
});
// create the data store
var mystore = new Ext.data.Store({
proxy: proxy,
reader: new Ext.data.JsonReader({
root: 'topics',
totalProperty:'totalProperty',
id: 'ML_Autoid'
},['ML_Autoid', 'M_Name', 'A_ID', 'M_lv', 'Perfect'])
});
mystore.load({ params: { start: 0, limit: 10} });
//定义列
var colM = new Ext.grid.ColumnModel([
{ header: '编号', dataIndex: 'ML_Autoid', sortable: true },
{ header: '名称', dataIndex: 'M_Name' },
{ header: '地区', dataIndex: 'A_ID' },
{ header: '级别', dataIndex: 'M_lv' },
{ header: '状态', dataIndex: 'Perfect' },
{
header: '删除',
xtype: 'actioncolumn',
width: 50,
items: [{
icon: '/js/ext3.3/examples/shared/icons/fam/delete.gif', // Use a URL in the icon config
handler: function (grid, rowIndex, colIndex) {
var rec = mystore.getAt(rowIndex);
recid = rec.get('ML_Autoid');
Ext.MessageBox.show({
title: '删除 ' + rec.get('M_Name') + '?',
msg: '确定删除 ' + rec.get('M_Name') + ' 这条记录?',
buttons: Ext.MessageBox.YESNO,
fn: delRecord,
icon: Ext.MessageBox.QUESTION
});
},
tooltip: 'Sell stock'
}]
},
{
header: '更新',
xtype: 'actioncolumn',
width: 50,
items: [{
icon: '/js/ext3.3/examples/shared/icons/fam/application_go.png', // Use a URL in the icon config
handler: function (grid, rowIndex, colIndex) {
var rec = mystore.getAt(rowIndex);
alert("Sell " + rec.get('ML_Autoid'));
},
tooltip: 'Sell stock'
}]
}
]);
//create the gridpanel
var grid = new Ext.grid.GridPanel({
store: mystore,
stripeRows: true,
//autoExpandColumn: 'ML_Autoid', 自动填充字段
autoHeight : true,
bodyStyle : 'width:100%',
autoHeight: true,
cm: colM,
loadMask: true,
autoWidth : true,
border:false,
title: '媒体库管理',
// config options for stateful behavior
stateful: true,
viewConfig: {
forceFit: true
},
stateId: 'grid',
tbar : new Ext.Toolbar({
items : [{
id : 'btnAdd',
icon: '/js/ext3.3/examples/shared/icons/fam/add.gif',
text : "添加",
handler : function() {
Ext.MessageBox.alert("添加","做添加的操作");
}
}
]
}),
bbar: new Ext.PagingToolbar({
pageSize: 10,
store: mystore,
displayInfo: true,
displayMsg: '第{0} 到 {1} 条数据 共{2}条',
emptyMsg: "没有数据"
})
});
// render the grid to the specified div in the page
grid.render('grid-example');
function delRecord(btn)
{
if(btn=="yes"){
alert(recid);
}
}
});
...全文
相关推荐
ext.net 动态创建gridpanel
使用ext.net代码动态创建gridpanel后任意显示在各种窗口中
Ext的gridpanel控件二次加载问题
Ext的gridpanel控件二次加载时丢失解决方案
EXT GridPanel获取某一单元格的值
EXT GridPanel获取某一单元格的值
Ext.net实现GridPanel拖动行、上移下移排序功能DEMO
对于GridPanel中拖动选中行排序的实现,网上有不少ExtJs实现的例子,但是没有找到使用Ext.net实现的,正好最近有个需求要使用,干脆来写一个。 DEMO功能说明: 1、拖动GridPanel选中行到新位置排序。 2、在拖动结束后,重新会选中前面拖动的行。 3、拖动排序功能支持Grid单选与多选模式。 4、加了【最上】【最下】【上移】【下移】四个按钮排序的功能。目前按钮排序只能在Grid的单选模式下使用。 实现说明与功能演示请见我的Blog
Ext2.2.GridPanel分页处理+dwrproxy(js对象和json两种数据)
NULL 博文链接:https://redboy5711.iteye.com/blog/259913


