Skip to content Skip to sidebar Skip to footer

How To Remove Delete Action Icon From Confirmed Order Rows In Jqgrid If Clickablecheckbox Formatter Is Used

jqGrid contains action formatter and boolean posted columns. I tried to hide Delete action button for posted rows in jqGrid in loadComplete using var iCol = getColumnIndexByName($g

Solution 1:

I think you should change the enumeration from the loadComplete to something like the following:

loadComplete: function () {
    var i, rows = this.rows, l = rows.length, row,
        iClosedCol = getColumnIndexByName($grid, 'Posted'),
        iActionsCol = getColumnIndexByName($grid, '_actions');
    for (i = 0; i < l; i++) {
        row = rows[i];
        if ($(row).hasClass('jqgrow')) {
            if ($(row.cells[iClosedCol]).find(">div>input:checked").length > 0) {
                $(row.cells[iActionsCol]).find(">div>div.ui-inline-del").hide();
            }
        }
    }
}

In the code you can be sure that you hide the "Delete" action button in exactly the same row where the 'Posted' column contains checked checkbox.

Post a Comment for "How To Remove Delete Action Icon From Confirmed Order Rows In Jqgrid If Clickablecheckbox Formatter Is Used"