var lastsel;
function defineGridOp() {
try {
$("#grid_op").jqGrid({
caption: "Nominas",
datatype: "local",
colNames: ['Nómina', 'Estado', 'Fecha Nómina', 'Total Nómina'],
colModel: [
{ name: 'numero_nomina', index: 'numero_nomina', width: '150px', align: 'center', formatter: 'number', sorttype: 'number', formatoptions: { decimalPlaces: 0} },
{ name: 'estado', index: 'estado', align: 'center', width: '200px', editable: false, hidden: false },
{ name: 'fecha_nomina', index: 'fecha_nomina', width: '200px', align: 'center', editable: false, hidden: false, formatter: 'date', formatoptions: { newformat: 'd/m/Y' } },
{ name: 'total_nomina', index: 'total_nomina', width: '300px', align: 'center', formatter: 'number',sorttype: 'number', formatoptions: { decimalPlaces: 0 } }
],
multiselect: true,
rowNum: 200,
pgbuttons: true,
pager: $('#pager2'),
viewrecords: true,
width: 950,
shrinkToFit: false,
autowidth: false,
onSortCol: true,
forceFit: true,
height: 400,
editurl: jutils.pageName(),
deselectAfterSort: false,
onSelectRow: function (id, status) {
if (id && id !== lastsel) {
$('#grid_op').jqGrid('restoreRow', lastsel);
}
}
});
$("#grid_op").jqGrid('navGrid', "#pager2", { edit: false, add: false, del: false, refresh: false, search: false });
$("#grid_op").jqGrid('navButtonAdd', '#pager2', { buttonicon: 'ui-icon-document', onClickButton: function () { Ver(); }, caption: ' Reimprimir Nómina ', title: ' Reimprimir Nómina ' });
$("#grid_op").jqGrid('navButtonAdd', '#pager2', { buttonicon: 'ui-icon-document', onClickButton: function () { Exportar(); }, caption: ' Excel', title: ' Exportar ' });
$("#grid_op").jqGrid('navButtonAdd', '#pager2', { buttonicon: 'ui-icon-document', onClickButton: function () { Ver2(); }, caption: ' Detalle', title: ' Report e' });
} catch (e) {
jutils.showError(e, arguments.callee.name);
}
}
No hay comentarios:
Publicar un comentario