var a = new Ext.form.Label({ text : '写信', style : 'background-color:#006666; color:#CCCCCC;padding-left:26px; padding-top:6px; height:24px;width:75px' }); var nav = new Ext.Panel({ region : 'west', split : true, width : 150, collapsible : true, margins : '3 0 3 3', cmargins : '3 3 3 3', layout : 'column', items : [{ columnWidth : .5, layout : 'form', items : [a] }]var win = new Ext.Window({ closable : false, width : 800, height : 500, plain : true, renderTo : Ext.getBody(), layout : 'border', items : [nav, tabs] }); win.show(this); 我想在label上添加一个点击事件,打开一个tab,可是怎么弄都不行,这个里面没法添加div啊
var a = new Ext.form.Label({ text : '写信', style : 'background-color:#006666; color:#CCCCCC;padding-left:26px; padding-top:6px; height:24px;width:75px' }); 那就用button代替吧。label 没有click事件
你可以用div来代替
<div id="div1"></div>
document.getElementById("div1").onclick=function(){}
text : '写信',
style : 'background-color:#006666; color:#CCCCCC;padding-left:26px; padding-top:6px; height:24px;width:75px'
});
var nav = new Ext.Panel({
region : 'west',
split : true,
width : 150,
collapsible : true,
margins : '3 0 3 3',
cmargins : '3 3 3 3',
layout : 'column',
items : [{
columnWidth : .5,
layout : 'form',
items : [a]
}]var win = new Ext.Window({
closable : false,
width : 800,
height : 500,
plain : true,
renderTo : Ext.getBody(),
layout : 'border',
items : [nav, tabs]
});
win.show(this);
我想在label上添加一个点击事件,打开一个tab,可是怎么弄都不行,这个里面没法添加div啊
text : '写信',
style : 'background-color:#006666; color:#CCCCCC;padding-left:26px; padding-top:6px; height:24px;width:75px'
});
那就用button代替吧。label 没有click事件