1

私のjqgridは、アイコンを使用して編集、保存、キャンセルするインライン編集を実装しており、正常に機能しますが、グリッドをjqueryタブに移動するだけで、同じアクションリンクが最近jqueryタブの外でテストしたorigianlaの代わりに異なるURLを実行します。

これがコードです、事前に感謝します:

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

1 に答える 1

0

問題はjqueryタブではなく、@Beginform{}であることがわかりました。jqgridがこの(Beginform)内にある場合、アクションアイコンは、jqgridで設定したurlactionではなく、フォームのコントローラーアクションを想定しています。

私の英語でごめんなさい。

于 2012-11-02T01:03:52.313 に答える