【发布时间】:2015-11-12 16:28:01
【问题描述】:
嗨,我正在尝试从我的网格中获取数据,但我无法从 clientArray 获取数据我正在使用此代码我不知道如何获取数据以在获取数据之前发送到远程服务器
var dataGridNuevaCajaMatriz = [{
'40': 0,
'50': 0,
'60': 0,
'70': 0,
'80': 0,
'90': 0,
'100': 0,
'110': 0
}];
jQuery("#grid_nueva_caja_matriz").jqGrid({
data: dataGridNuevaCajaMatriz,
datatype: "local",
//datatype: "json",
loadonce: true,
/*height:'400',*/
colNames:['40','50','60','70','80','90', '100', '110'],
colModel:[
//{name:'seleccion',index:'', width:50, align: 'center',editable: false, formatoptions: {disabled : false}, editoptions: {value:"1:0" },editrules:{required:false}},
{name:'40',index:'40', width:50, align:"center",editable:true},
{name:'50',index:'50', width:50, align:"center",editable:true},
{name:'60',index:'60', width:50, align:"center",editable:true},
{name:'70',index:'70', width:50, align:"center",editable:true},
{name:'80',index:'80', width:50, align:"center",editable:true},
{name:'90',index:'90', width:50, align:"center",editable:true},
{name:'100',index:'100', width:50, align:"center",editable:true},
{name:'110',index:'110', width:50, align:"center",editable:true},
],
rowNum:999999,
pager: '#pager_nueva_caja_matriz',
toppager:false,
pgbuttons:false,
pginput:false,
rowList:false,
gridview:false,
shrinkToFit: false,
jsonReader: {
repeatitems : false,
cellEdit: true,
cellsubmit : 'clientArray',
editurl: 'clientArray',
},
loadError: function (jqXHR, textStatus, errorThrown) {
message_error('ERROR','HTTP message body (jqXHR.responseText): ' + '<br>' + jqXHR.responseText);
},
//ondblClickRow
onSelectRow: function(){
var row_id = $("#grid_nueva_caja_matriz").getGridParam('selrow');
jQuery('#grid_nueva_caja_matriz').editRow(row_id, true);
}
});
jQuery("#form_nueva_caja_matriz #grid_nueva_caja_matriz").jqGrid('navGrid','#pager_nueva_caja_matriz',{edit:false,add:false,del:false});
如何获取数据 clienteArray 我无法获取这些。请帮我 谢谢
【问题讨论】:
-
您想在网格中使用哪种编辑模式:单元格编辑还是内联编辑?您不能在同一个网格中使用两种编辑模式。目前,您使用
cellEdit: true, cellsubmit : 'clientArray'进行单元格编辑,并且包含行选择的editRow的开始(请参阅onSelectRow回调)。您在输入数据中使用了非常奇怪的列名(colModel中的name属性)和 no rowids(每个 for 都没有具有唯一值的id属性)。你的问题也不清楚。您是否需要在要获取修改后的数据以发送到服务器的页面上设置一些“保存”按钮?