jqgridjqgrid-inlinenav

How to disbale inline grid edit for full grid depending on some value


I have something like authorization and lets say if the user doesnt have edit authorization, then I dont want to provide the inline edit option. How is this possible.

if(NotAuthorized)
{ $grid.jqGrid('hideCol', "act");}

UPDATE Have updated the answer as per suggestion below

function evaluateAuthorization(authorizations) {
$("#gridList").find(".ui-inline-edit,.ui-inline-del,.ui-inline-save,.ui-inline-cancel")
.addClass("ui-state-disabled")
.prop("onclick", null)
.prop("onmouseover", null)
.prop("onmouseout", null); 
}

This got me what i wanted.


Solution

  • It I understand you correctly you can disable the buttons inside of loadComplete. The code could be about the following

    loadComplete: function () {
        $(this).find(".ui-inline-edit,.ui-inline-del,.ui-inline-save,.ui-inline-cancel")
            .addClass("ui-state-disabled")
            .prop("onclick", null)
            .prop("onmouseover", null)
            .prop("onmouseout", null);
    }