There is a [HttpPost] Controller's Action, define FormCollection to get the values of form 。
when the view submit,can not get values.
$("#bomdg").datagrid({
toolbar: '#tb',
singleSelect: true,
onClickRow: onClickRow,
columns: [[
{
title: 'material',
field: 'pdm_bomdetail_tb_id_part',
width: 180,
formatter: function (value, row) {
return row.name;
},
editor: {
type: 'combobox',
options: {
valueField: 'id',
textField: 'name',
method: 'get',
url: '/Bom/GetPartData',
required: true,
missingMessage: 'request',
onSelect: function (value) {
var row = $("#bomdg").datagrid('getSelected');
var rindex = $("#bomdg").datagrid('getRowIndex', row);
bomver = $('#bomdg').datagrid('getEditor', { index: rindex, field: 'pdm_bomdetail_tb_id_part_bom' });
if (value.id == '') return;
$.getJSON('/Bom/GetPartBom', { partid: value.id }, function (data) {
bomver.target.combobox('loadData', data);
bomver.target.combobox("setValue", "");
edv = $('#bomdg').datagrid('getEditor', { index: rindex, field: 'bom_version' });
$(edv.target).textbox('setValue', "");
});
$.getJSON('/Bom/GetSinglePart', { partid: value.id }, function (data) {
var edc = $('#bomdg').datagrid('getEditor', { index: rindex, field: 'part_code' });
$(edc.target).textbox('setValue', data[0].code);
var edn = $('#bomdg').datagrid('getEditor', { index: rindex, field: 'part_name' });
$(edn.target).textbox('setValue', data[0].name);
});
}
}
}
},
{
title: 'material_code',
field: 'part_code',
width: 80,
editor: {
type: 'textbox',
options: {
readonly: true
}
}
},
{
title: 'material_name',
field: 'part_name',
width: 180,
editor: {
type: 'textbox',
options: {
readonly: true
}
}
},
{
title: 'BOM_code',
field: 'pdm_bomdetail_tb_id_part_bom',
width: 120,
formatter: function (value, row) {
return row.bomname;
},
editor: {
type: 'combobox',
options: {
valueField: 'id',
textField: 'name',
data: databom,
onSelect: function (value) {
var row = $("#bomdg").datagrid('getSelected');
var rindex = $("#bomdg").datagrid('getRowIndex', row);
if (value.id == '') return;
$.getJSON('/Bom/GetBomVersion', { bomid: value.id }, function (data) {
var edc = $('#bomdg').datagrid('getEditor', { index: rindex, field: 'bom_version' });
$(edc.target).textbox('setValue', data[0].code);
});
}
}
}
},
{
title: 'BOM Version',
field: 'bom_version',
width: 80,
editor: {
type: 'textbox',
options: {
readonly: true
}
}
},
{
title: 'qty',
field: 'pdm_bomdetail_tb_qty',
width: 80,
editor: {
type: 'numberbox', options: { precision: 4, min: 0, required: true, missingMessage: 'request' }
}
}
]]
});