jqgrid - acciones de formateador predefinidas - cambie la acción predeterminada del botón de edición de la fila seleccionada

Can we change the default action of the "edit selected row" button?

Here is my code for the grid

jQuery("#detFlex62_1").jqGrid({
    url: root + mod + '/detaillistview', 
    datatype: "clientSide", 
    colNames:[' ', '<?=lang("users_company_code")?>', '<?=lang("users_company_name")?>', ' ', ' '], 
    colModel:[ 
        {name:'myac', width:50, fixed:true, sortable:false, resize:false, formatter:'actions', formatoptions:{keys:true,delOptions: {reloadAfterSubmit:false},editOptions: {reloadAfterSubmit:false}}},
        {name:'company_code',index:'company_code', width:100}, 
        {name:'company_name',index:'company_name', width:100}, 
        {name:'company_id',index:'company_id', width:100,hidden:true}, 
        {name:'company_access_id',index:'company_access_id', width:100,hidden:true} 
        ], 
    width: $('.body').width()-40, 
    height: 120, 
    pager: '#pagerFlex62_1', 
    sortname: 'user_id', 
    sortorder: "desc", 
    editurl: root + mod + '/detailpost',
    caption:"<?=lang("users_title")?>", 
    onSelectRow: function(id){ 
        activedf = "#detFlex62_1";
    }
}); 

jQuery("#detFlex62_1").jqGrid('navGrid','#pagerFlex62_1',{edit:false,del:false,search:false, addfunc: df_add_1});

I know I should put something in the editOptions part of the code. Right now I only put reloadAfterSubmit:false. What is the option to execute our own custom function ?

preguntado el 30 de junio de 12 a las 18:06

1 Respuestas

If you need just calling custom function when you press 'Edit' button in navigation bar, your navgrid should look like this:

jQuery("#detFlex62_1").jqGrid('navGrid', "#mainGridNavi", { edit: true, add: false, del: false, editfunc: function() { alert('test'); }})

Saludos.

Respondido el 30 de junio de 12 a las 19:06

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.