次のグリッドを想定します
$(document).ready(function() {
$('#Clientes').jqGrid({colNames: ['Razón Social','Cuit','Dirección','Localidad','Teléfono','Tipo IVA','Mail','Saldo inicial','Facturar'],
colModel: [{ editable: true, editoptions: { "maxlength":70 }, editrules: { required: true }, name: 'RazonSocial' },
{ editable: true, editoptions: { dataInit: CuitMask, "maxlength":13 }, editrules: { custom: true, custom_func: ValidateCuit, required: true }, name: 'NidentFiscal' },
{ editable: true, editoptions: { "maxlength":70 }, editrules: { required: true }, name: 'Direccion' },
{ editable: true, edittype: 'select', editoptions: { dataUrl: '/Ciudad/CmbCiudad' }, editrules: { required: true }, name: 'Ciudad' },
{ editable: true, editoptions: { "maxlength":20 }, name: 'Telefono' }],
url: '/Clientes/List',
datatype: 'json',
mtype: 'POST',
pager: '#ClientesPager',
prmNames: { id: 'ClienteId' },
rowList: [10,15,20,25,30],
sortname: 'ClienteId',
subGrid: true,
subGridRowExpanded: function(subgridId, rowId) {
var subgridTableId = subgridId + '_t';
jQuery('#' + subgridId).append('<table id="' + subgridTableId + '"></table>');
var subgridPagerId = subgridId + '_p';
jQuery('#' + subgridId).append('<div id="' + subgridPagerId + '"></div>');
$('#' + subgridTableId).jqGrid({colNames: ['Fecha','Importe'],
colModel: [{ name: 'Fecha' },
{ editable: true, editrules: { number: true }, formatter: 'currency', formatoptions: { prefix: '$' }, name: 'Importe' }
],url: '/Honorarios/DetailSubgrid?id=' + rowId, datatype: 'json', mtype: 'POST', pager: '#' + subgridPagerId,
prmNames: { id: 'HonorarioId' },
rowList: [10,15,20,25,30],
sortname: 'HonorarioId',
viewrecords: true,
width: 600,
height: '100%'}).jqGrid('navGrid', '#' + subgridPagerId,{ search: false },{ url: '/Honorarios/Update', closeAfterEdit: true },{ url: '/Honorarios/Update', closeAfterEdit: true },{ url: '/Honorarios/Delete' });
},
viewrecords: true,
width: 1000,
height: '100%'
}).jqGrid('navGrid', '#ClientesPager',{ search: false },{ url: '/Clientes/Update', width: 500, closeAfterEdit: true }, { url: '/Clientes/Update', width: 500, closeAfterEdit: true }, { url: '/Clientes/Delete' });
});
サブグリッドでレコードを追加または編集するときにClienteIdパラメーターを渡す必要があります。これはpostdataを使用して行う必要がありますか?何かのようなもの
postData: {ClienteId: row_id}