
- 帖子
- 1
- 主題
- 0
- 精華
- 0
- 積分
- 3
- 威望
- 0
- 金錢
- 1
|
本帖最後由 kenber 於 2010-6-18 11:23 編輯
回覆: 請問我要新增button,但中文字按紐為何顯示不出來?
包含驗證的內容, 改貼這一段就可以囉! ^_^
<script>
Ext.onReady(function(){
var fm2 = new Ext.form.BasicForm('form2');
fm2.add(new Ext.form.TextField({applyTo: 'text2'}));
fm2.add(new Ext.form.ComboBox({transform:'st2'}));
fm2.add(new Ext.form.DateField({applyTo: 'dp2'}));
fm2.add(new Ext.form.TextArea({applyTo: 'ta2'}));
Ext.get('form2').un("submit", fm2.onSubmit, fm2);
var newbutton = new Ext.Button({
renderTo:'newbutton',
text: '按鈕',
handler: function(){
if (fm2.isValid()) {
Ext.Msg.show({
title:'再確認一下',
msg: '按下 OK 就把資料送出囉,你確定嗎?',
buttons: Ext.Msg.OKCANCEL,
fn: function(btn, text){
if (btn == 'ok'){
fm2.el.dom.submit();
} else if (btn == 'cancel') {
Ext.Msg.alert('告訴你', '你按了取消,所以不會送出!');
}
},
animEl: 'newbutton'
});
} else {
Ext.Msg.alert('訊息', '請填寫完成後再送出!');
}
}
});
fm2.add(new Ext.form.TextField({
applyTo:'text2',
allowBlank: false
})
);
var textAreaSettings = {
applyTo:'ta2',
grow: true,
allowBlank: false
};
fm2.add(new Ext.form.TextArea(textAreaSettings));
});
</script> |
|