CheckBox(復(fù)選框)主要用來接收用戶選擇的選項(xiàng)
如圖所示(請忽略UI的不好看):
復(fù)制代碼 代碼如下:
var win = new Ext.Window({
modal : true,
title : '確定要拒絕該表嗎?',
width : 500,
plain : true,
items : [fp]
});
win.show();
復(fù)制代碼 代碼如下:
var fp = Ext.create('Ext.FormPanel', {
frame: true,
fieldDefaults: {
labelWidth: 110
},
width: 500,
bodyPadding: 10,
items: [
{
xtype: 'fieldset',
flex: 1,
//title: '確定要拒絕該張表嗎?',
defaultType: 'checkbox',
layout: 'anchor',
defaults: {
anchor: '100%',
hideEmptyLabel: false
},
items:[{
fieldLabel: '請選擇拒絕原因:',
boxLabel: '該表沒有填寫完整。',
name:'integrity',
inputValue: '1'
}, {
name:'correct',
boxLabel: '該表填寫不準(zhǔn)確。',
inputValue: '1'
}]
}],
buttons: [
{text: '確認(rèn)',handler: function(){
//得到完整性和準(zhǔn)確性信息 有則為1 沒有為0
if(fp.getForm().isValid()){
console.log(fp.getForm().findField('integrity').getValue()?1:0);
console.log(fp.getForm().findField('correct').getValue()?1:0)
}
win.hide();
}
},{
text: '取消',
handler: function(){
win.hide();
}
}]
});
復(fù)制代碼 代碼如下:
console.log(fp.getForm().findField('integrity').getValue()?1:0);
console.log(fp.getForm().findField('correct').getValue()?1:0)
新聞熱點(diǎn)
疑難解答
圖片精選