kreamik
kreamik

Reputation: 627

how to recreate navgrid from beginning?

lets say i have have

var user.colModel = {"name":'agentNo',"index":'agentNo', "width":100, "align":"center","editable":true};

jQuery("#navgrid").jqGrid(
        "navGrid",
        "#pagernav", 
        {   edit:true,add:true,del:true,refresh:true,search:false,
            afterRefresh: function(){
                $("#navgrid").setGridParam({'datatype':'json'}).trigger('reloadGrid');
            }
        }, //options 
        {   
            "height":450,
            "width":350,
            onInitializeForm:function()
            {
                // agent
                $('#agentNo').prop('disabled',true);
            },
            afterSubmit : function(response, postdata)
            {},
            closeAfterEdit : true,
            reloadAfterSubmit: true
        }, // edit options 
        {
            "height":450,
            "width":350,
            onInitializeForm:function()
            {},
            afterSubmit : function(response, postdata)
            {},
            closeAfterAdd : true,
            reloadAfterSubmit: true
        }, // add options 
        {
            afterSubmit : function(response, postdata)
            {},
            reloadAfterSubmit: true
        }, // del options 
        {} // search options 
);

i have one col (agentNo) in data that only allowed to be filled when adding data but restricted to be filled when editing data. but now i have problem when inserting new data after editing some item, i disable the text input inside edit properties to prevent user edit the number agent,

how to recreate the navGrid to allowed filling text input.

Upvotes: 0

Views: 1003

Answers (1)

Oleg
Oleg

Reputation: 221997

If I understand correct your problem you should use recreateForm: true option of form editing. You should set the option for both Add and Edit dialogs.

Upvotes: 1

Related Questions