Ext.onReady(function(){ var data = [ [1,"wilson.fu",10], [2,"wilson.fu2",20], [3,"wilson.fu3",30] ]; var s" />

ExtJS Grid使用SimpleStore、多选框的方法



///<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
//得到选择的行的值
});

});

Exitjs获取DataView中图片文件名
1、前台scripttype="text/javascript"language="javascript"functionaa(){varselNode=this.DataView1.getSelectedNodes()[0];alert(selNode.id);}/script2、后台protectedvoidPage_Load(objectsender,EventArg

extJs 文本框后面加上说明文字+下拉列表选中值后触发事件
varshowForm;functionpanelShowForm(){showForm=null;showForm=newExt.FormPanel({renderTo:"showPanel",region:'north',border:false,bodyBorder:false,frame:true,waitMsgTarget:true,labelAlign:'right',id:"show

ExtJS下grid的一些属性说明
1.界面修改(cssstyle):Extjs中界面风格与我们产品本身的风格有很大不同,从边框、选中行的颜色到鼠标移动到的行的颜色、菜单等,几乎都不同。Extjs对