0

I want to disable row cell in Jqgrid in loadcomplete . I am using this code:

loadComplete: function () {

                var ids = $grid.jqGrid('getDataIDs');
                for (var i = 0; i < ids.length; i++) {

                    var rowId = ids[i];
                    var rowData = $grid.jqGrid('getRowData', rowId);
                    if (rowData.IsActive) {
                        rowData.Save.attr("disabled", true); //Error comes here

                    }

                }
            }

if is active cell is true i want to disable col cell save disabled. If condition running fine but in " rowData.Save.attr("disabled", true);" (Save is the column name) it does not work. It show error it is not a function. How can i do ths?

Hiba
  • 231
  • 1
  • 7
  • 23
  • Possible duplicate of [Disable a row in jQGrid](http://stackoverflow.com/questions/17818891/disable-a-row-in-jqgrid) – xZ6a33YaYEfmv Oct 01 '15 at 07:26
  • I suppose that you use wrong terminology. One can **disable** only elements on HTML page which have user interaction. For example you can disable `` or ` – Oleg Oct 01 '15 at 07:30
  • The current code use `getRowData` to get **the data** (**the text**) from the row. `rowData.Save` is string which one get from the column `"Save"` (if you have the column. you should post `colModel` in the case too). It's **not** the DOM element which attributes you can change. – Oleg Oct 01 '15 at 07:34
  • OLEG how can i disable row? Is there any other way – Hiba Oct 01 '15 at 07:39
  • I want to disable Save col if isactive is true. – Hiba Oct 01 '15 at 07:40
  • Please use "@Oleg" in comments if more as one person wrote comments before. I can repeat that disabling of the row, which contains only the text, or disabling the text in "Save" column have no sense. You can't disable something, which is not enabled. The simple text is not enabled and so it can't be disabled. You don't posted **how the grid looks like** and **what you have in the column "Save"**. You can include pictures, `colModel` and to describe **which changing of the behavior of the row/cell you expect from "disabling"**. – Oleg Oct 01 '15 at 07:57

1 Answers1

0

How about this rowData.jqGrid('setColProp', 'YouColumnName', {editable:false});

arun bahal
  • 328
  • 3
  • 13