I'm having troubles using jqGrid and thickbox on the same page. I'm using "reloadGrid" method in order to refresh Array data.
The jqGrid init :
jQuery("#tablaCompromisos").jqGrid({
datatype: "local",
height: 270,
width: 1000,
colNames: ['ID', 'Nombre Reunión', 'Reunión', 'Descripción', 'Cierre', 'Estado', 'Prioridad', 'Responsable R1', 'Responsable 2', 'Categoría'],
cmTemplate: {
resizable: false
},
colModel: [
{ width: 60, name: 'idCompromiso', index: 'idCompromiso', sorttype: "int", align: "center" },
{ width: 300, name: 'reunion.nombre', index: 'reunion.nombre', sorttype: "string" },
{ width: 90, name: 'fechaReunion', index: 'fechaReunion', sorttype: "string", align: 'center', formatter: 'date', formatoptions: { newformat: 'd/M/Y' }, classes: 'reuFecha' },
{ width: 300, name: 'descCompromiso', index: 'descCompromiso', sorttype: "string", classes: 'compDesc' },
{ width: 90, name: 'fechaCierre', index: 'fechaCierre', sorttype: "string", align: 'center', classes: 'fechaCierre', formatter: 'date', formatoptions: { newformat: 'd/M/Y'} },
{ width: 60, name: 'estado.nombre', index: 'estado.orden', sorttype: "int", align: 'center', classes: 'estado', formatter: fomatoEstado },
{ width: 90, name: 'prioridad.nombre', index: 'prioridad.orden', sorttype: "int", align: 'center', formatter: fomatoPrioridad, classes: 'prioridad' },
{ name: 'responsableR1.nombre', index: 'responsableR1.nombre', sorttype: "string", classes: 'resp1' },
{ name: 'responsableR2.nombre', index: 'responsableR2.nombre', sorttype: "string", classes: 'resp2' },
{ name: 'categoria.nombre', index: 'categoria.orden', sorttype: "string", classes: 'categoria' }
],
multiselect: false,
caption: "Listado de compromisos según filtro",
rowNum: 11,
pager: "#tablaCompromisosPag",
autowidth: false,
shrinkToFit: false,
altRows: true
});
The refresh method :
$("#tablaCompromisos").jqGrid('clearGridData').jqGrid('setGridParam', { datatype: 'local', data: CargarDatosGrilla() }).trigger("reloadGrid");
It's all ok, but after click in the link :
<a onclick="cargarGraficoAvance();return false;" title="Ver gráfico de avance" class="thickbox" href="#TB_inline?height=410&width=610&inlineId=wrapperGrafico">11,11</a>
The next calls to
$("#tablaCompromisos").jqGrid('clearGridData').jqGrid('setGridParam', { datatype: 'local', data: CargarDatosGrilla() }).trigger("reloadGrid");
throws errors on updatepager method because ts is null:
ts is null
http://localhost/gestion/js/jquery.jqGrid.src.js
Line 1578
The reason :
$(window).unload(function () {
ts = null;
});
I've changed the method, avoiding call "ts = null", but there is another fix to that? there are other implications by making that change?
Thanks in advance
The fix :
http://core.trac.wordpress.org/ticket/19189
You must patch your thickbox.js file :
http://core.trac.wordpress.org/attachment/ticket/19189/19189-2.patch