JQGrid: Dynamically set a cell to uneditable based on content

前端 未结 3 1841
情深已故
情深已故 2020-12-03 15:32

I\'m having some issues getting some cells (with cellEdit: true) to be non-editable even though the column is set to editable.

I\'ve tried many ways, like beforeEdi

3条回答
  •  眼角桃花
    2020-12-03 16:28

    The idea to use setCell method to add class 'not-editable-cell' to the cells which should be not-editable is correct. You choose only the wrong place to do this. Inside of custom formatter, the grid can be not yet built till the end. I recommend you to use loadComplete or gridComplete to examine the grid contain of the current page and mark some cells as not-editable.

    I prepared an example which demonstrate this. Like in your example all cells having "test" text are marked as non-editable. In the way you can examine one cells and mark another cells as non-editable.

提交回复
热议问题