欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Extjs 4.x 得到form CheckBox 復(fù)選框的值

 更新時(shí)間:2014年05月04日 11:25:13   作者:  
CheckBox(復(fù)選框)主要用來接收用戶選擇的選項(xiàng),那么如何通過Extjs 4.x 得到form CheckBox的值呢?下面有個(gè)不錯(cuò)的方法,大家值得一看
CheckBox(復(fù)選框)主要用來接收用戶選擇的選項(xiàng)

如圖所示(請(qǐng)忽略UI的不好看):



該彈出窗口的主要代碼如下:
復(fù)制代碼 代碼如下:

var win = new Ext.Window({
modal : true,
title : '確定要拒絕該表嗎?',
width : 500,
plain : true,
items : [fp]
});
win.show();

彈出的窗口是載體,items里面的[fp]是form表單的句柄。

具體定義如下:
復(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: '請(qǐng)選擇拒絕原因:',
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();
 }
  }]
  });

這里面基本涵蓋了所有的感興趣的信息。具體的參見API吧本身不難

著重說下得到checkBox的值
復(fù)制代碼 代碼如下:

console.log(fp.getForm().findField('integrity').getValue()?1:0);
console.log(fp.getForm().findField('correct').getValue()?1:0)

這兩句話就是如何得到完整性和正確性的值。

相關(guān)文章

最新評(píng)論