【问题标题】:Strange behavior on Inline Editing when jqgrid is on jquery Tab当 jqgrid 在 jquery 选项卡上时,内联编辑的奇怪行为
【发布时间】:2012-10-20 09:40:21
【问题描述】:

我的 jqgrid 使用图标来编辑、保存、取消实现内联编辑,它工作正常,但是当我简单地将网格移动到 jquery 选项卡中时,相同的操作链接执行不同的 url,而不是我最近在 jquery 选项卡之外测试的 origianla。

这是代码,在此先感谢:

jQuery("#listPagos").jqGrid({
                url: '/FacturaProveedor/ListaPagos?facturaid=' + document.getElementById("FacturaProveedorId").value,
                datatype: 'json',
                mtype: 'GET',
                colNames: ['FacturaProveedorId', 'ID', 'Vence', 'Importe', 'Programado', 'Pago', 'ImportePagado', 'Saldo', ''],
                colModel: [
                    { name: 'FacturaProveedorId', index: 'FacturaProveedordeId', editable: true, width: 20, editoptions: { disabled: 'disabled' }, hidden: true },
                    { name: 'FacturaProveedorPagoId', index: 'ItemId', width: 20, editable: true, editoptions: { disabled: 'disabled' }, hidden: true },
                    { name: 'FechaVencimiento', index: 'NombreCorto', width: 70, editable: true, sorttype: 'date', formatter: 'date', formatoptions: { srcformat: 'd-m-Y', newformat: 'd-m-Y' }, align: 'center' },
                    { name: 'ImporteAPagar', index: 'Unidades', width: 50, editable: true },
                    { name: 'FechaProgramacion', index: 'Unidades', width: 70, editable: false, sorttype: 'date', formatter: 'date', formatoptions: { srcformat: 'd-m-Y', newformat: 'd-m-Y' }, align: 'center' },
                    { name: 'FechaPago', index: 'Unidades', width: 70, editable: false, sorttype: 'date', formatter: 'date', formatoptions: { srcformat: 'd-m-Y', newformat: 'd-m-Y' }, align: 'center' },                    
                    { name: 'ImportePagado', index: 'Unidades', width: 50, editable: false, hidden: true },
                    { name: 'Saldo', index: 'Unidades', width: 100, editable: false },
                    { name: 'act', index: 'act', width: 50, sortable: false },
                ],
                pager: jQuery('#pager'),
                rowNum: 10,
                rowList: [5, 10, 20, 50],
                sortname: 'Id',
                sortorder: "desc",
                viewrecords: true,
                gridComplete: function () {
                    var ids = jQuery("#listPagos").jqGrid('getDataIDs');
                    for (var i = 0; i < ids.length; i++) {
                        var cl = ids[i];
                        be = "<input  type='image' style='padding: 0 5px 0 5px;' src='/Content/img/pencil_color.gif' onclick=\"jQuery('#listPagos').editRow('" + cl + "');\"  />";
                        se = "<input  type='image' style='padding: 0 5px 0 5px;' src='/Content/img/disk_color.png' onclick=\"jQuery('#listPagos').saveRow('" + cl + "');\"  />";
                        ce = "<input  type='image' style='padding: 0 5px 0 5px;' src='/Content/img/cancel_color.png' value='C' onclick=\"jQuery('#listPagos').restoreRow('" + cl + "');\" />";
                        jQuery("#listPagos").jqGrid('setRowData', ids[i], { act: be + se + ce });
                    }
                },
                editurl: '/FacturaProveedor/ActualizaProgramacionPago',
                caption: '',
                loadonce: true,
                autowidth: true,
            });

【问题讨论】:

    标签: jquery jqgrid tabs inline editing


    【解决方案1】:

    我发现问题不是 jquery 选项卡而是 @Beginform{} 当 jqgrid 位于此(Beginform)操作图标内时,假定表单的控制器操作而不是我在 jqgrid 中设置的 te urlaction。

    对不起我的英语。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-10-09
      相关资源
      最近更新 更多