第一种:通过获得gridPanel中的Id(加入id为sysMenu_right)
var gp = Ext.getCmp('sysMenu_right').getSelectionModel();
var selected = gp.getSelected();//返回收割选择的记录
//判断有没有记录被选中.
if(selectM){
Ext.ux.Window().dialog({
title:'新增',
id:'sysMenu_funoptrefAdd',
width: 400,
height:160,
url:'sysMenu/funoptrefEdit.html?action=funoptrefAdd&funcId='+selectM.id});
}else{
MsgTip.show({msg : '请选择部门!',icon:MsgTip.TIP});
}
第二种:树形 通过获得gridPanel中的Id(加入id为sysMenu_right)
var gp = Ext.getCmp('sysMenu_right').getSelectionModel();
var selected = gp.getSelectedNode();
第三种:通过声明 var userPrivGrid = Ext.GridPanel()...
var selectionModel=userPrivGrid.getSelectionModel();
if(selectionModel.getCount()==1){
Ext.ux.Window().dialog({title:'修改',
id:'userPriv_update',
width: 380,
url:'userPriv/edit.html?action=update&privId='+selectionModel.getSelected().data.privId});
}else{
new Ext.ux.MsgTip({html : "请选择一笔数据!",icon:'icon-tip'});
}