jQWidgets Forums

jQuery UI Widgets Forums Grid Button in JqxGrid Reply To: Button in JqxGrid

Button in JqxGrid #82633

Rai
Participant
function myFunction(row, column, value) {
// get the clicked row’s data and initialize the input fields.
var offset = $(“#grillaResultados”).offset();
var dataRecord = $(“#grillaResultados”).jqxGrid(‘getrowdata’, row);
var numContrato = dataRecord.NumeroContrato;
alert(“Numero de contrato: [" + dataRecord.NumeroContrato + "]“);
// show the popup window.
$(“#popupWindowLog”).jqxWindow(‘open’);
//$(“#popupWindowLog “).jqxWindow(‘open’, { height: ’100%’, width: ‘auto’, theme: ‘ui-start’, isModal: true });
//Dibujo la grillaResultado2
var origen2 = new $.jqx.dataAdapter
({
type: ‘post’,
datatype: ‘json’,
//Campos que enviaremos a la función para realizar la consulta
data: { ‘numContr’: numContrato },
datafields: [
{ name: 'fechaRegistro', type: 'string' },
{ name: 'pasoProceso', type: 'string' },
{ name: 'usuario', type: 'string' },
{ name: 'descrDetalleLog', type: 'string' }
],
url: ‘@Url.RouteUrl(“ConsultarLogAuditoria_default”, new { area = “ConsultarLogAuditoria”, controller = “LogAuditoria”, action = “ListarDetalle” })’,
sortcolumn: ‘fechaRegistro’,
sortdirection: ‘asc’,
beforeprocessing: function (data) {
},
pager: function (pagenum, pagesize, oldpagenum) {
// callback called when a page or page size is changed.
}
}); //Fin origen2 del jqx.dataAdapter
$(“#grillaResultados2″).jqxGrid(
{
//autoheight: true,
//autorowheight: true,
width: ’100%’,
source: origen2,
theme: ‘default’,
scrollmode: ‘deferred’,
localization: { loadtext: “Cargando” },
columns: [
{ text: 'Fecha de Registro', columngroup: 'InfOpCre', datafield: 'fechaRegistro', width: '16%', editable: false },
{ text: 'Paso del Proceso', columngroup: 'InfOpCre', datafield: 'pasoProceso', width: '14%', editable: false },
{ text: 'Usuario', columngroup: 'InfOpCre', datafield: 'usuario', width: '28%', editable: false },
{ text: 'Descripción Detalle del Log', columngroup: 'InfOpCre', datafield: 'descrDetalleLog', width: '100%', editable: false }
],
columngroups: [
{ text: 'Log de Eventos Proceso de Inyección de Operaciones', align: 'left', name: 'InfOpCre', theme: 'ui-start' }
]
}); //Fin Grilla Resultado2
}
$(function () {
$(‘#btnBuscar’).click(function (evento)
{
evento.preventDefault();
var columnsrenderer = function (value) {
return ‘<div style=”text-align: center; margin-top: 5px;”>’ + value + ‘</div>’;
}
var origen = new $.jqx.dataAdapter
({
type: ‘post’,
datatype: ‘json’,
//Campos que enviaremos a la función para realizar la consulta
data: { ‘fecDesde’: fecDesde, ‘fecHasta’: fecHasta, ‘cmbUsu’: cmbUsu, ‘numContr’: numContr },
datafields: [
{ name: 'FechaRegistro', type: 'string'},
{ name: 'NumeroContrato', type: 'string' },
{ name: 'EstadoFinalOpe', type: 'string' },
{ name: 'TipoUsuario', type: 'string' }
],
url: ‘@Url.RouteUrl(“ConsultarLogAuditoria_default”, new { area = “ConsultarLogAuditoria”, controller = “LogAuditoria”, action = “Listar” })’,
sortcolumn: ‘FechaRegistro’,
sortdirection: ‘asc’,
root: ‘Rows’,
beforeprocessing: function (data) {
}
}); //Fin origen del jqx.dataAdapter
$(“#grillaResultados”).jqxGrid(
{
//autoheight: true,
//autorowheight: true,
width: ’100%’,
height: 300,
source: origen,
theme: ‘default’,
scrollmode: ‘deferred’,
localization: { loadtext: “Cargando” },
columns: [
{ text: 'Fecha de Registro', columngroup: 'InfOpCre', datafield: 'FechaRegistro', width: '20%', editable: false, sortable: true },
{ text: 'N° Contrato', columngroup: 'InfOpCre', datafield: 'NumeroContrato', width: '10%', editable: false },
{ text: 'Estado Final Operación', columngroup: 'InfOpCre', datafield: 'EstadoFinalOpe', width: '20%', editable: false },
{ text: 'Usuario', columngroup: 'InfOpCre', datafield: 'TipoUsuario', width: '35%', editable: false },
{
text: 'Ver Detalle Log', renderer: columnsrenderer, datafield: 'Log', columngroup: 'InfOpCre', width: '13%'/*, columntype: 'button'*/, editable: false,
cellsrenderer: function (row, column, value) {
//return "Log";
return '<button style="width: 100%;background-color:transparent;"></button>';
}, buttonclick: function (row) {
// get the clicked row's data and initialize the input fields.
/*
var offset = $("#grillaResultados").offset();
var dataRecord = $("#grillaResultados").jqxGrid('getrowdata', row);
var numContrato = dataRecord.NumeroContrato;
// show the popup window.
$("#popupWindowLog").jqxWindow('open');
//$("#popupWindowLog ").jqxWindow('open', { height: '100%', width: 'auto', theme: 'ui-start', isModal: true });
//Dibujo la grillaResultado2
var origen2 = new $.jqx.dataAdapter
({
type: 'post',
datatype: 'json',
//Campos que enviaremos a la función para realizar la consulta
data: { 'numContr': numContrato },
datafields: [
{ name: 'fechaRegistro', type: 'string' },
{ name: 'pasoProceso', type: 'string' },
{ name: 'usuario', type: 'string' },
{ name: 'descrDetalleLog', type: 'string' }
],
url: ‘@Url.RouteUrl(“ConsultarLogAuditoria_default”, new { area = “ConsultarLogAuditoria”, controller = “LogAuditoria”, action = “ListarDetalle” })’,
sortcolumn: ‘fechaRegistro’,
sortdirection: ‘asc’,
beforeprocessing: function (data) {
},
pager: function (pagenum, pagesize, oldpagenum) {
// callback called when a page or page size is changed.
}
}); //Fin origen2 del jqx.dataAdapter
$(“#grillaResultados2″).jqxGrid(
{
//autoheight: true,
//autorowheight: true,
width: ’100%’,
source: origen2,
theme: ‘default’,
scrollmode: ‘deferred’,
localization: { loadtext: “Cargando” },
columns: [
{ text: 'Fecha de Registro', columngroup: 'InfOpCre', datafield: 'fechaRegistro', width: '16%', editable: false },
{ text: 'Paso del Proceso', columngroup: 'InfOpCre', datafield: 'pasoProceso', width: '14%', editable: false },
{ text: 'Usuario', columngroup: 'InfOpCre', datafield: 'usuario', width: '28%', editable: false },
{ text: 'Descripción Detalle del Log', columngroup: 'InfOpCre', datafield: 'descrDetalleLog', width: '100%', editable: false }
],
columngroups: [
{ text: 'Log de Eventos Proceso de Inyección de Operaciones', align: 'left', name: 'InfOpCre', theme: 'ui-start' }
]
}); //Fin Grilla Resultado2*/
}
}
],
columngroups: [
{ text: 'Log de Auditoría', align: 'left', name: 'InfOpCre', theme: 'ui-start' }
]
});
});