我对 MVC、jQuery 和 jqGrid 非常陌生。在过去的两天里,我一直在寻找有关如何在用户单击添加按钮时重定向到另一个页面的解决方案。我也需要在编辑按钮上做同样的事情,但在这样做之前我需要调用一个javascript函数来检查请求的行是否可以被编辑。
非常感谢任何帮助。
这是我用来创建 jqGrid 的代码
var jqDataUrl = "Account/LoadBaseData";
        $(document).ready(function () {
            // Set up the jquery grid
            $("#ListTable").jqGrid({
                // Ajax related configurations
                url: jqDataUrl,
                datatype: "json",
                mtype: "POST",
                // Specify the column names
                colNames: ["Bank","Account No","Account Name"],
                // Configure the columns
                colModel: [ { name: "BankReference", index: "BankReference", width: 40, align: "left"}, { name: "AccountNo", index: "AccountNo", width: 40, align: "left"}, { name: "AccountName", index: "AccountName", width: 40, align: "left"}],
                // Grid total width and height
                width: 850,
                height: 400,
                // Paging
                toppager: true,
                pager: $("#ListTablePager"),
                rowNum: 14,
                viewrecords: true, // Specify if "total number of records" is displayed
                // Grid caption
                caption: "BankAccount List",
                editurl: "/GridDemo/GridSave",
            }).navGrid("#ListTablePager",
            { refresh: true, add: true, edit: true, del: true},
                { }, // settings for edit
                {}, // settings for add
                {}, // settings for delete
                {sopt: ["cn"]}  
            );
        });
提前谢谢你。