1. varbtnnewExt. button ({text: & amp; #39; ddd & amp; #39 ;}); btn. on (& amp; #39; & amp; #39;, function (B) {B. addClass (& amp; #39; newCSS & amp; #39;) ;}); 2. /* edit */. edit {background-image
1.
Var btn = new Ext. Button ({text: 'ddd '});
Btn. on ('', function (B ){
B. addClass ('newcss ');
});
2.
/* Edit */
. Edit {
Background-image: url (../images/toolbarIcon/edit.png )! Important;
}
/* Publish */
. Release {
Background-image: url (../images/toolbarIcon/release.png )! Important;
}
Var btn = new Ext. ButtonGroup ({
Id: 'edit ',
Text: 'editor ',
Handler: onRelease,
IconCls: 'edit' // style Image
});
Function onRelease (){
Btn. setIconClass ('release'); // change the image
Btn. setText ('release ');
}
[Javascript]
{
Id: '_ kbkg ',
Xtype: 'button ',
Text: 'Open course table ',
IconCls: 'unlock ',
Listeners :{
'Click': function (t ){
Var text = t. getText ();
If (text = "open course schedule "){
T. setText ("Close course schedule ");
T. setIconClass ('lock ');
KbCheck (1 );
} If (text = 'close course list '){
T. setText ("open course schedule ");
T. setIconClass ('unlock ');
KbCheck (0 );
}
}
}
}
[Javascript]
[Javascript]
Ext. getCmp ("xn_label"). setText ("school year:" + xn );
Ext. getCmp ("xq_label"). setText ("term:" + xq );
// Switch the course schedule
Function KbCheck (v ){
Ext. Ajax. request ({
Url: contextPath + '/system/lxdmglAction. do? Method = getKbkg ',
/*
Success: function (request ){
},
Failure: function (request ){
},
*/
Params: {kva: v}
});
}
Ext. Ajax. request ({
Url: contextPath + '/system/lxdmglAction. do? Method = getKbkgValue ',
Success: function (request ){
Rs = Ext. decode (request. responseText );
If (rs = "1 "){
Ext. getCmp ("_ kbkg"). setText ("Close course schedule ");
Ext. getCmp ("_ kbkg"). setIconClass ('lock ');
}
}/*,
Failure: function (request ){
Ext. Msg. alert ("failed to load the course schedule. Please try again! ");
}*/
});
Author: zhx624