標籤:new url win 更新 hand title window 相同 input
ExtJs2.0好像不支援單選框組,因此用兩個name相同單選框來實現單選框組
var radio1 =
new Ext.form.Radio({boxLabel:‘男‘,name:‘sex‘,id:‘yes‘,inputValue:‘0‘,width : 150, height : 20});
var radio2 =
new Ext.form.Radio({boxLabel:‘女‘,name:‘sex‘,id:‘no‘,inputValue:‘1‘, width : 150,height : 20}); //性別配置FieldSet
var fieldSet =
new Ext.form.FieldSet({ title : ‘性別配置‘, autoHeight :
true, width : 350, labelAlign : ‘right‘, labelwidth : 110, bodyStyle : ‘padding:5px 5px 0‘, layout:‘column‘, items : [{ columnWidth : .5, items:radio1 //radio1一定要寫在單獨的items裡面,不然在頁面顯示的效果就是兩個單選框的圓圈在前面,兩個單選框選項的描述在後面 }, { columnWidth : .5, items: radio2 }]});
var fp =
new Ext.FormPanel({ id : ‘sex_mode‘, labelWidth : 110, waitMsg : ‘正在提交,請稍後...‘, frame :
true, width : 380, autoHeight :
true, layout:‘column‘, items : [fieldSet]});
var winKey =
new Ext.Window({ id : "sex_win", title : ‘[性別]維護‘, autoHeight :
true,// 320, width : 400, closeAction : ‘hide‘, closable:
false, iconCls : ‘add‘, modal :
true, buttons : [{ text : ‘提交‘, id : ‘button‘, handler :
function() {
var sex = fp.form.findField("sex").getGroupValue();
if(sex != ‘‘ && sex !=
undefined && sex !=
null){ fp.form.submit({ url : ‘‘, //配置性別的方法 waitTitle : "[性別]修改", waitMsg : ‘正在提交資料,請稍後... ...‘, success :
function(form, action) { Ext.MessageBox.alert(‘提示資訊‘,action.result.msg); }, failure :
function(form, action) { Ext.MessageBox.alert(‘提示資訊‘, "更新性別有誤!"); } }); }
else{ Hs.util.Msg(‘提示資訊‘, ‘請選擇性別!‘); } } }], items : [fp]});
ExtJs2.0裡Ext.form.Radio水平排列布局