ifti24
ifti24

Reputation: 191

jqGrid : How to remove edit options?

I have created a button and there I have attached the edit event in the following way -

$("#editButton").click(function() {
    var gr = jQuery("#gridTable").jqGrid('getGridParam', 'selrow');

    if (gr != null) {
        jQuery("#gridTable").jqGrid('editGridRow', gr, editParams);
    } else
        alert("Please Select Row");
});

But it is creating a problem for me. Here you see I'm setting the editParams again. I think this is the problem. Can I remove the existing editParams before adding them again?

Upvotes: 0

Views: 399

Answers (2)

Oleg
Oleg

Reputation: 221997

Probably you need include more code which shows your implementation. Calling of the close function twice should be fixed. You should debug the error "h is undefined" (with respect of Developer Tools for example), look at the call stack and post in which line of jquery.jqGrid.src.js it take place. You should additionally verify which JavaScript files and in which order there were loaded. Probably including some JavaScript more as one time or you made unneeded binding. It could be the source of the original problem.

Upvotes: 1

Zav
Zav

Reputation: 661

Looks like you need "editRow" method.

$("#editButton").click(function() {
    var gr = $.jqGrid.getGridParam('selrow');

    if (gr != null) {
        $.jqGrid.editRow(gr);
    } else {
        alert("Please Select Row");
    }
});

work for you?

Upvotes: 0

Related Questions