Steve Dyke
Steve Dyke

Reputation: 175

Send Extra Parameters with jqGrid Edit Callback

I use the jqgrid free version. I need to send an extra parameter along with the edit callback using inline editing.

This is my code but the extra parameters are not getting to the servlet.

$("#csstsoplacardarrangmentlist").jqGrid   ('inlineNav',"#csstsoplacardarrangmentlistpager",
    {edit:true,add:false,del:false,search:true,view:false},
    {editParams: {editRowParams:{keys: true, extraparam: {quickfillflag:$('.quickfillflag2').prop("checked")}}}});

Upvotes: 1

Views: 424

Answers (1)

Oleg
Oleg

Reputation: 221997

The code which you included in your question contains property extraparam with the value {quickfillflag:$('.quickfillflag2').prop("checked")}. The object will be initialized once during executing of inlineNav. Additionally you use editRowParams property, which is unknown. You should place properties of inline editing directly under editParams.

If I correctly understand your problem then the problem will be solved by usage quickfillflag defined as function:

$("#csstsoplacardarrangmentlist").jqGrid('inlineNav', 
    "#csstsoplacardarrangmentlistpager",
    { edit: true, add: false },
    {
        editParams: {
            keys: true,
            extraparam: {
                quickfillflag: function () {
                    return :$('.quickfillflag2').prop("checked");
                }
            }
        }
    });

Additionally I'd recommend you to specify the options of inline editing inside of inlineEditing option of jqGrid. After that you can reduce the option of inlineNav. For example, you can use jqGrid options

inlineNavOptions: {
    edit: true,
    add: false
},
inlineEditing: {
    keys: true,
    extraparam: {
        quickfillflag: function () {
            return :$('.quickfillflag2').prop("checked");
        }
    }
}

and to use inlineNav as

$("#csstsoplacardarrangmentlist").jqGrid('inlineNav');

Upvotes: 2

Related Questions