phpjqgridfree-jqgridjqgrid-php

How to display add form in jqgrid?


     $("#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});

Its work fine,when i click a add button the from will be opened enter image description here like this.How to add the text box in this form.when I add the edit url the working page will show as blank page..


Solution

  • You should add the property editable: true in all columns of colModel, which you want to allow to edit. For example you can use

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