当Ext.js中xtype: 'checkboxfield'时,没勾选则向后台发送的数据没有字段的解决方法

//压烫工艺单-添加部件
Ext.define('MVC.view.Business.Tech.lroningSubForm', {
extend: 'Ext.form.FieldSet',
alias: 'widget.BusinessTechlroningSubForm',
collapsible: true,
padding: 10,
margin: 5,
boder: false,
autoScroll: true,
initComponent: function () {
var me = this;
var required = '<span style="color:red;font-weight:bold" data-qtip="必输项">*</span>';
var cellEditing = Ext.create('Ext.grid.plugin.CellEditing', {
clicksToEdit: 1 //进入编辑状态的单击次数
});
Ext.applyIf(me, {
items: [

{
xtype: 'form',
type: 'headForm',
width: '800',
layout: {
columns: 5,
type: 'table',
tdAttrs: {
valign: 'top'
}
},
defaultType: 'checkboxfield',
fieldDefaults: {
labelWidth: 95,
labelAlign: 'left',
margin: '0 5 5 10',
width: 250
},
boder: false,
autoScroll: true,
bodyPadding: 5,
margins: '0 0 2 0',
items: [
{
xtype: 'container',
colspan: 5,
items: [
{
xtype: 'hiddenfield',
name: 'autoid'
},
{
xtype: 'hiddenfield',
name: 'id'
}
]
},
{
xtype: 'button',
text: '删除部件',
colspan: 5,
margin: '0 0 10 0',
iconCls: 'delete2',
name: 'deletePart'
},
{
fieldLabel: '压烫部位',
name: 'cLocation',
xtype: 'hiddenfield'
},
{
xtype: 'tbtext',
text: '类别:'
},
{
xtype: 'checkboxfield',
fieldLabel: '转印片',
labelAlign: 'right',
name: 'bTransfer',
checked: true,
inputValue: true,
uncheckedValue: false,
submitValue: true
},
{
fieldLabel: '烫钻(钉)',
name: 'bRhinestone',
inputValue: true,
uncheckedValue: false,
checked: true
},
{
fieldLabel: '切割片',
name: 'bCutting',
inputValue: true,
uncheckedValue: false,
checked: true
},
{
fieldLabel: '备胶纸',
name: 'bTape',
inputValue: true,
uncheckedValue: false,
checked: true
},
{
xtype: 'tbtext',
text: ''
},
{
fieldLabel: '其他',
name: 'bOther',
uncheckedValue: false,
inputValue: true,
checked: true
},
{
xtype: 'tbtext',
text: ''
},
{
xtype: 'tbtext',
text: ''
},
{
xtype: 'tbtext',
text: ''
},
Ext.create('Ext.ux.FileUploadField', {
fieldLabel: '压烫图案位置',
labelWidth: 95,
width: 300,
margin: '14 0 8 10',
buttonText: '上传',
name: 'cIroningPic',
docIDFieldName: 'autoid',
IDRequire: true, //是否必须有单据id(在单据保存前无id值)
btnEnableState: ['2'],
handleUrl: 'data/public/FileUpload.ashx', //后台处理类
srvSavePath: '~/upload/Ironings/ProcessGraph/', //文件保存路径(一般为相对路径)
docType: 'Ironings', //单据类型
colspan: 5
}),

{
xtype: 'textfield',
name: 'cOrientation',
fieldLabel: '定位要求',
width: 180,
margin: '12 0 20 10'
},
{
fieldLabel: '按稿1:1压烫',
labelWidth: 95,
name: 'bIroningRatio',
margin: '12 0 20 10',
inputValue: true,
uncheckedValue: false,
checked: true
},
{
xtype: 'tbtext',
text: ''
},
{
xtype: 'tbtext',
text: ''
},
{
xtype: 'tbtext',
text: ''
},

{
xtype: 'container',
colspan: 5,
height: 34,
html: "<div style='height:34px;line-height:34px;font-size: 16px; font-weight: bold; color: #000000; font-family: 宋体;text-align:center;letter-spacing:2em;'>样品操作及压烫要求</div>"
},
{
xtype: 'container',
colspan: 5,
height: 30,
html: "<div style='height:30px;line-height:30px;font-size: 14px;color: #000000; font-family: 宋体;'>******压烫前多余的胶纸沿花样边缘修剪整齐,待完全冷却后撕离(冷撕)</div>"
},
{
xtype: 'container',
colspan: 5,
height: 30,
html: "<div style='height:30px;line-height:30px;font-size: 14px;color: #000000; font-family: 宋体;'>******上层有粘性的胶纸压烫完成后保留上层胶纸,待完成帽子后再撕(防止后续操作中刮坏花样)</div>"
},

{
fieldLabel: '正压',
name: 'bPositivePressure',
inputValue: true,
uncheckedValue: false,
checked: true
},
{
fieldLabel: '反压',
name: 'bCounterPressure',
inputValue: true,
uncheckedValue: false,
checked: true

},
{
fieldLabel: '其他条件',
name: 'bOtherConditions',
inputValue: true,
uncheckedValue: false,
checked: true
},
{
xtype: 'tbtext',
text: ''
},
{
xtype: 'tbtext',
text: ''
},
{
xtype: 'container',
colspan: 5,
height: 34,
html: "<div style='height:34px;line-height:34px;font-size: 16px; font-weight: bold; color: #000000; font-family: 宋体;text-align:center;letter-spacing:2em;'>压烫机型及压烫参数</div>"
},
{
fieldLabel: '平版压烫机',
name: 'bFlatplatePressingMachine',
inputValue: true,
uncheckedValue: false,
checked: true
},
{
xtype:'textfield',
fieldLabel: '压力',
afterLabelTextTpl: '公斤/平方(Mpa)',
width:180,
name: 'fFlatplatePressure'
},
{
xtype: 'textfield',
fieldLabel: '时间',
afterLabelTextTpl: '秒',
width: 180,
name: 'fFlatplateTime'
},
{
xtype: 'textfield',
fieldLabel: '温度',
afterLabelTextTpl: '℃',
width: 180,
name: 'fFlatplateteMperature'
},
{
xtype: 'textfield',
fieldLabel: '至',
afterLabelTextTpl: '℃',
width: 180,
name: 'fFlatplateteToMperature'
},


{
fieldLabel: '有利压烫机',
name: 'bFavorablePressingMachine',
inputValue: true,
uncheckedValue: false,
checked: true
},
{
xtype: 'textfield',
fieldLabel: '压力',
afterLabelTextTpl: '公斤/平方(Mpa)',
width: 180,
name: 'fFavorablePressure'
},
{
xtype: 'textfield',
fieldLabel: '时间',
afterLabelTextTpl: '秒',
width: 180,
name: 'fFavorableTime'
},
{
xtype: 'textfield',
fieldLabel: '温度',
afterLabelTextTpl: '℃',
width: 180,
name: 'fFavorableMperature'
},
{
xtype: 'textfield',
fieldLabel: '至',
afterLabelTextTpl: '℃',
width: 180,
name: 'fFavorableToMperature'
},
{
fieldLabel: '双头压烫机',
name: 'bDoubleHeadPressingMachine',
inputValue: true,
uncheckedValue: false,
checked: true
},
{
xtype: 'textfield',
fieldLabel: '压力',
afterLabelTextTpl: '公斤/平方(Mpa)',
width: 180,
name: 'fDoubleHeadPressure'
},
{
xtype: 'textfield',
fieldLabel: '时间',
afterLabelTextTpl: '秒',
width: 180,
name: 'fDoubleHeadTime'
},
{
xtype: 'textfield',
fieldLabel: '温度',
afterLabelTextTpl: '℃',
width: 180,
name: 'fDoubleHeadMperature'
},
{
xtype: 'textfield',
fieldLabel: '至',
afterLabelTextTpl: '℃',
width: 180,
name: 'fDoubleHeadToMperature'
},
{
fieldLabel: '其他机型:',
name: 'bOtherPressingMachine',
inputValue: true,
uncheckedValue: false,
checked: true
},
{
xtype: 'textfield',
fieldLabel:'机型名称',
name: 'cOtherPerssingMachineName',
width: 180,
colspan:4

},
{
xtype: 'tbtext',
text: ''
},
{
xtype: 'textfield',
fieldLabel: '压力',
afterLabelTextTpl: '公斤/平方(Mpa)',
width: 180,
name: 'fOtherPressure'
},
{
xtype: 'textfield',
fieldLabel: '时间',
afterLabelTextTpl: '秒',
width: 180,
name: 'fOtherTime'
},
{
xtype: 'textfield',
fieldLabel: '温度',
afterLabelTextTpl: '℃',
width: 180,
name: 'fOtherMperature'
},
{
xtype: 'textfield',
fieldLabel: '至',
afterLabelTextTpl: '℃',
width: 180,
name: 'fOtherToMperature'
},

]
},


{
xtype: 'gridpanel',
type: 'grid1',
enableGridMemu: true, //允许右键菜单
exceptCopyColumns: ['autoid'], //不参与复制的列名(仅当enableGridMemu=true时有效)
plugins: [cellEditing],
store: Ext.create('MVC.store.Business.Tech.lroningSubDocumentGrid'),
columns: [
new Ext.grid.RowNumberer({
recordStart: 0,
renderer: function (value, metadata, record, rowIndex) {
return this.recordStart + 1 + rowIndex;
}
}),

{
dataIndex: 'cColor',
text: '面料色',
sortable: true,
width: 130,
editor: {
allowBlank: true

}
},
{
xtype: 'numbercolumn',
dataIndex: 'iQuantity',
text: '数量',
sortable: true,
width: 130,
editor: {
xtype: 'numberfield',
allowBlank: true,
regex: /^(([1-9]+[0-9]*.{1}[0-9]+)|([0].{1}[1-9]+[0-9]*)|([1-9][0-9]*)|([0][.][0-9]+[1-9]*))$/,
regexText: "输入数字必须大于等于0!",
allowDecimals: false, //不允许输入小数
format: '0'
}
},
{
dataIndex: 'cIroningColor',
text: '压烫配色',
sortable: true,
width: 130,
editor: {
allowBlank: true

}
}
],
viewConfig: {

},
dockedItems: [
{
xtype: 'toolbar',
dock: 'top',
items: [{
xtype: 'label',
margin: 5,
style: 'font-weight:bold;',
text: '特殊要求'
},
{
xtype: 'tbseparator'
},
{
xtype: 'button',
action: 'insertRow',
iconCls: 'insertRow',
text: '增行'
},
{
xtype: 'button',
action: 'deleteRow',
iconCls: 'deleteRow',
text: '删行'
}, '-',
{
xtype: 'button',
action: 'copyRow',
iconCls: 'copy',
text: '复制'
},
{
xtype: 'button',
action: 'pasteRow',
iconCls: 'paste_plain',
text: '粘贴'
}, '-', {
xtype: 'button',
action: 'insertBefore',
iconCls: 'insertRow',
text: '插入空行'
}]
}
]
}


]
});

me.callParent(arguments);
}

});

posted @ 2017-09-18 13:48  picker4  阅读(782)  评论(0编辑  收藏  举报