javascriptjqgrid

JQgrid - onCellSelect does not trigger for cell editing


In JQgrid, if you want to do some pre-processing stuff before the cell of a table is edited ( the input is rendered on the DOM ). You can't do that, because for some reason the onCellSelect does not trigger at all. Reading the docs, it states that when doing inline cell editing, the onCellSelect event is disabled. Its kind of ambiguous, in the sense that the naming itself refers to cells being selected, so what's the reason to disable it ?

I've used the following properties to enable cell editing

   cellEdit : true,
   cellsubmit : 'clientArray',
   restoreCellonFail: true

Catching the cell selected event on

onCellSelect: (rowid, cellid, cellvalue) => {
   ....  do some stuff, like remove the formatter
}

Solution

  • Not sure which docs you read and which version is used, but you have two other ways to solve the problem.

    1. In case you use formatter , you can use unformat to parse the format before editing.

    2. the event beforeEditCell is more natural as name and is called just before editing