2013-01-23 27 views
0

假设以下电网HOWTO传递亚格Jqgird额外PARAM

$(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} 

回答

0

的解决方案是使用

editData: { ClienteId: rowId } 

坦克@tpeczek