在这下面的代码我得到所需的输出
EXTJS - 新手,开关箱的功能不能正常工作
fn: function(btn) {
switch(btn){
case 'yes':
Ext.Msg.prompt('Milton', 'Where is it?');
break;
case 'no':
Ext.Msg.alert('Milton',
'Im going to burn the building down!');
break;
case 'cancel':
Ext.Msg.wait('Saving tables to disk...','File Copy');
break;
}
}
这工作就好了。现在我试图在开关'yes'中做一个函数调用,但是我没有在屏幕上得到任何输出。
这是我正在使用的代码。
case 'yes':
Ext.Msg.prompt('Milton', 'Where is it?', function(btn,txt)
{
if (txt.toLowerCase() == 'the office') {
Ext.get('my_id').dom.innerHTML = 'Dull Work';
}else{
Ext.get('my_id').dom.innerHTML = txt;
}
Ext.DomHelper.applyStyles('my_id',{
background: 'transparent
url(images/stapler.png) 50% 50% no-repeat'
});
});
break;
在swich case'yes'中使用此代码,我得到一个空白屏幕。即使对话框消失了。请帮忙。
什么是你在控制台得到错误控制台? –
@LorenzMeyer感谢您的回复。我在控制台中没有收到任何错误。至少它应该显示对话框。但我所得到的只是一个空白的屏幕。 – SeasonalShot