• JqGrid 编辑单元格内容时提示url未设定错误 2018-08-06


    感谢大佬的资料https://blog.csdn.net/Easy_____/article/details/30218421

    虽然没实例,但也给了一些信息。我以为cellsubmit属性是添加到colModel里面的!实际并不是,

    而是添加到jqGrid里面

    //加载Grid
        function LoadGrid() {
            $("#gridTable1").jqGrid({
                datatype: "local",
                height: $(window).height() - 550,
                auto true,
                colModel: [
                    { label: "商品名称", name: "goodsName", index: "goodsName",  450, align: "center" },
                    { label: "商品Sku", name: "orderSku", index: "orderSku",  200, align: "center" },
                    { label: "商品件数", name: "count", index: "count",  90, align: "center" },
                    { label: "原始出厂单价", name: 'primitiveFactoryPrice', index: 'primitiveFactoryPrice',  200, sorttype: "float", align: "center" },
                    { label: "规格", name: 'spec', index: 'spec',  100, align: "center" },
                    { label: "单位", name: "unit", index: "unit",  50, align: "center" },
                    {
                        label: "物流单号<font style="color:red;" face="宋体">*</font>", name: "waybill",
                        index: "waybill",  200, align: "center"
                    },
                    {
                        label: "物流公司<font style="color:red;" face="宋体">*</font>", name: "company",
                        index: "carrier",  200, align: "center"
                    },
                ],
                viewrecords: true,
                rowNum: 30,
                rownumbers: true,
                shrinkToFit: false,
                gridview: true,
                cellEdit: true,
                cellsubmit: "clientArray",//不需要传入后台 设置为clientArray。需要的时候可以设置为romote
                //gridComplete: function () {
                //    var ids = jQuery("#gridTable1").jqGrid('getDataIDs');
                //    for (var i = 0; i < ids.length; i++) {
                //        var cl = ids[i];
                //        var ae = '<input id="waybill_' + i + 1 + '" name="waybill_name" onchange="function(this){ $(this).attr("value", this.value);}" >';
                //        var be = '<input list="company_' + i + 1 + '_list" id="company_' + i + 1 + '" name="company_name" onchange="getCompany(this)"/><datalist id="company_' + i + 1 + '_list" style="display: none;"></datalist>';
                //        jQuery("#gridTable1").jqGrid('setRowData', ids[i], { company: be ,waybill:ae});
                //    }
                //}
            });
            $("#gridTable1").setColProp("waybill", { editable: true });//设置列可编辑
            $("#gridTable1").setColProp("company", { editable: true });//设置列可编辑
        }

    运行结果

    我的jqGrid版本的colModel属性设置了editable并不支持

    然后用setColProp方法才支持

        $("#gridTable1").setColProp("waybill", { editable: true });//设置列可编辑
        $("#gridTable1").setColProp("company", { editable: true });//设置列可编辑
  • 相关阅读:
    链表相加
    Unity 摄像机跟随
    整数反转
    两数和
    频繁项集挖掘思路
    有关于二进制的乘法计算(原码一位乘)
    JAVA面向对象(下)
    JAVAAPI
    JAVA面向对象()上)
    JAVA基础第一章
  • 原文地址:https://www.cnblogs.com/bklsj/p/9431655.html
Copyright © 2020-2023  润新知