如何在jqgrid中显示添加表单?

时间:2018-04-25 16:11:47

标签: php jqgrid free-jqgrid jqgrid-php

     $("#list_records").jqGrid({
                    url: "getGridData.php",
                    datatype: "json",
                    mtype: "GET",
                    colNames: ["UserId", "Mobile Number"],
                    colModel: [
                        { name: "id",align:"right"},
                    { name: "mobilenumber"}

                    ],
                    pager: "#perpage",
                    rowNum: 10,
                    rowList: [10,20],
                    sortname: "id",
                    sortorder: "asc",
                    height: 'auto',
                    viewrecords: true,
                    gridview: true,
                   // editurl: 'getGridData.php'
                    caption: ""

                }); 
 jQuery("#list_records").jqGrid('navGrid','#perpage',{edit:true,add:true,del:true});

它的工作正常,当我点击一个添加按钮时,将会打开这样的enter image description here。如何在此表单中添加文本框。当我添加编辑网址时,工作页面将显示为空白页面..

1 个答案:

答案 0 :(得分:0)

您应该在要editable: true的所有列中添加属性colModel,您希望对其进行编辑。例如,您可以使用

colModel: [
    { name: "id", align:"right" },
    { name: "mobilenumber", editable: true }
]