相思资源网 Design By www.200059.com
复制代码 代码如下:
///<reference path="./vswd-ext_2.0.2.js" />
Ext.onReady(function(){
var data = [
[1,"wilson.fu",10],
[2,"wilson.fu2",20],
[3,"wilson.fu3",30]
];
var sqldata = new Array() ;
for(var i=0;i<10;i++)
{
sqldata.push([i.toString(),"wilson.fu" + i.toString(),10*i]);
}
var sm = new Ext.grid.CheckboxSelectionModel({handleMouseDown:Ext.emptyFn});
var cm = new Ext.grid.ColumnModel([
sm,
{header:"编号",dataIndex:"id",sortable:true},
{header:"姓名",dataIndex:"name"},
{header:"排序值",dataIndex:"ordernum",sortable:true}
]);
var store = new Ext.data.SimpleStore({
fields:[
{name:"id"},
{name:"name"},
{name:"ordernum"}
]
});
store.loadData(sqldata);
var gd = new Ext.grid.GridPanel({
renderTo:"grid",
cm:cm,
sm:sm,
store:store,
loadMask:true
});
Ext.get("btn").on("click",function(){
var selections = gd.getSelectionModel().getSelections();
debugger
//得到选择的行的值
});
});
///<reference path="./vswd-ext_2.0.2.js" />
Ext.onReady(function(){
var data = [
[1,"wilson.fu",10],
[2,"wilson.fu2",20],
[3,"wilson.fu3",30]
];
var sqldata = new Array() ;
for(var i=0;i<10;i++)
{
sqldata.push([i.toString(),"wilson.fu" + i.toString(),10*i]);
}
var sm = new Ext.grid.CheckboxSelectionModel({handleMouseDown:Ext.emptyFn});
var cm = new Ext.grid.ColumnModel([
sm,
{header:"编号",dataIndex:"id",sortable:true},
{header:"姓名",dataIndex:"name"},
{header:"排序值",dataIndex:"ordernum",sortable:true}
]);
var store = new Ext.data.SimpleStore({
fields:[
{name:"id"},
{name:"name"},
{name:"ordernum"}
]
});
store.loadData(sqldata);
var gd = new Ext.grid.GridPanel({
renderTo:"grid",
cm:cm,
sm:sm,
store:store,
loadMask:true
});
Ext.get("btn").on("click",function(){
var selections = gd.getSelectionModel().getSelections();
debugger
//得到选择的行的值
});
});
标签:
ExtJS,Grid
相思资源网 Design By www.200059.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
相思资源网 Design By www.200059.com
暂无ExtJS Grid使用SimpleStore、多选框的方法的评论...