PDA

View Full Version : Help with some buttons event



mephi
1 Jul 2008, 6:41 AM
hi guys .. I have some problem on click event for a button in IE. On mozzila is working good.



var closeTerm = new Ext.Button({
text: 'Close Term'
});
var clicked = 0;
closeTerm.on('click',function(evt){
if (clicked == 0){
closeTerm.setText('Reopen Term');
termName.disable();
clicked = 1;
}
else if (clicked == 1){
closeTerm.setText('Close Term');
termName.enable();
clicked = 0;
}
});
It give me this error: " htmlfile: Unknown runtime error " and after debugging with Visual Web Dev 2008 I fount the error linking to this part of code : "this.dom.innerHTML=html".
Please help me out.

yazan_rababa
1 Jul 2008, 7:03 AM
what is termName ?
try to comment

termName.enable();
termName.disable();

Animal
1 Jul 2008, 7:39 AM
Looks like you really want a CycleButton there.

mephi
1 Jul 2008, 10:27 PM
well termName is a textField, and I give the short version of code ... I have some comboBox fields, textFields, numberFields and some other buttons that need to go disable/enable on button press.

mephi
1 Jul 2008, 10:35 PM
So to be more specific, I have a panel with 2 textFields, 1 numberField, 2 combobox, and 2 buttons (1 is closeTerm). When I click closeTerm btn I want all other combonents to go disable/enable depending on the state of btn.

mephi
1 Jul 2008, 11:43 PM
I have copy/paste the code for CycleButton from Api and it seems that it is not working on IE. It gives the same error.



var btn = new Ext.CycleButton({
showText: true,
prependText: 'View as ',
items: [{
text:'text only',
iconCls:'view-text',
checked:true
},{
text:'HTML',
iconCls:'view-html'
}],
changeHandler:function(btn, item){
Ext.Msg.alert('Change View', item.text);
}
});