第一步:要给grid绑定双击事件。
我们用的是celldblclick 双击单元格事件。
里面的参数cellIndex 让我们能够快速地获取到所在列的索引。
第二步:初始化窗口
createWin : function(){
this.win = Ext.create('Ext.window.Window', {
width : 1380,
height : 700,
resizable : false,
title : 'xxx',
modal : true,
closeAction : 'hide',
reference : 'win',
layout : 'fit'
});
}
第三步:找出标题。然后调用窗口的show()方法。
this.grid.on('celldblclick ',
function(t, td, cellIndex, record, tr, rowIndex, e, eOpts){
// 通过columnManger获取所在列的标题.
var text = t.getColumnManager().
getHeaderAtIndex(cellIndex).text;
//如果是二级头
var text1 = t.getColumnManager().
getHeaderAtIndex(cellIndex).ownerCt.text;
if(text == '客户'){
//初始化
this.createWin();
this.win.show();
}
},this);