重定义extjs中button被点击后的样式
1.
var btn = new Ext.Button({text:'ddd'});
btn.on('',function(b){
b.addClass('newCSS');
});
2.
/*编辑*/
.edit {
background-image: url(../images/易做图Icon/edit.png) !important;
}
/*发布*/
.release {
background-image: url(../images/易做图Icon/release.png) !important;
}
var btn= new Ext.ButtonGroup({
id : 'edit',
text : '编辑',
handler : onRelease,
iconCls : 'edit'//样式图片
});
function onRelease(){
btn.setIconClass('release');//更改图片
btn.setText('发布');
}
[javascript]
{
id:'_kbkg',
xtype: 'button',
text:'打开课表',
iconCls:'unlock',
listeners: {
'click': function(t){
var text = t.getText();
if(text == "打开课表"){
t.setText("关闭课表");
t.setIconClass('lock');
KbCheck(1);
}if(text == '关闭课表'){
t.setText("打开课表");
t.setIconClass('unlock');
KbCheck(0);
}
}
}
}
[javascript]
[javascript]
Ext.getCmp("xn_label").setText(" 学年: " + xn);
Ext.getCmp("xq_label").setText(" 学期: " + xq);
//课表开关
function KbCheck(v){
Ext.Ajax.request({
补充:web前端 , JavaScript ,