【问题标题】:jqGrid and thickbox when using reloadGrid使用reloadGrid时的jqGrid和thickbox
【发布时间】:2012-04-04 18:15:28
【问题描述】:

我在同一页面上使用 jqGrid 和thickbox 时遇到问题。我正在使用“reloadGrid”方法来刷新数组数据。

jqGrid 初始化:

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
    });

刷新方法:

$("#tablaCompromisos").jqGrid('clearGridData').jqGrid('setGridParam', { datatype: 'local', data: CargarDatosGrilla() }).trigger("reloadGrid");

一切正常,但点击链接后:

<a onclick="cargarGraficoAvance();return false;" title="Ver gráfico de avance" class="thickbox" href="#TB_inline?height=410&amp;width=610&amp;inlineId=wrapperGrafico">11,11</a>

下一次调用

$("#tablaCompromisos").jqGrid('clearGridData').jqGrid('setGridParam', { datatype: 'local', data: CargarDatosGrilla() }).trigger("reloadGrid");

在 updatepager 方法上抛出错误,因为 ts 为空:

ts is null
http://localhost/gestion/js/jquery.jqGrid.src.js
Line 1578

原因:

$(window).unload(function () {
   ts = null;
});

我已经改变了方法,避免调用“ts = null”,但是还有另一个解决方法吗?做出这种改变还有其他影响吗?

提前致谢

【问题讨论】:

标签: jquery json jqgrid thickbox


【解决方案1】:
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-07-20
  • 2016-05-18
  • 1970-01-01
相关资源
最近更新 更多