title:'Milton',
msg:'Haveyouseenmystapler?',
buttons:Ext.Msg.YES
});
Ext.Msg.show({
title:'Milton',
msg:'Haveyouseenmystapler?',
buttons:Ext.Msg.YESNO
});
這中方式是使用Msg默認的button,ext默認有下面幾種button組合
Ext.MessageBox.OK
Ext.MessageBox.YES
Ext.MessageBox.NO
Ext.MessageBox.CANCEL
Ext.MessageBox.OKCANCEL
Ext.MessageBox.YESNO
Ext.MessageBox.YESNOCANCEL
基本夠用。如果妳想自定義button,可以采用下面的方法
Ext.MessageBox.show({
title:'Milton',? msg:?'Haveyouseenmystapler?',? buttonText:?{yes:'Button1',?no:'Button2'},? fn:?function?(btn)?{ console.log(btn); }});
當然,buttonText中的yes和no也都需要是在Ext.MessageBox中定義過得。其實無非就是換個名字,原來叫yes,妳現在自定義成Button1了。