Hello Tony,
click event handler can be called with e.tagret which is DOM of tbody, tr, td or some sub-element of td. If one select a text in the grid using mouse then click event will be triggered on mouse up. So If one selects text of multiple rows of the grid then tbody will be e.tagret. If one select a text from multiple columns of one row then tr will be e.target. The case when e.target is td or some sub-element of td is the most standard case.
The current implementation of click event handler contains the lineÂ
1 |
ptr = $(td,ts.rows).closest("tr.jqgrow"); |
The next tests whether $(ptr).length === 0 and makes return this; (which should be return; or return true; by the way). So the case where tbody will be e.tagret will be not a problem.
On the other side the case when tr will be e.target follow to setting ci=-1 and tdHtml=undefined in the linesÂ
1 2 |
ci = $.jgrid.getCellIndex(td); tdHtml = $(td).closest("td,th").html(); |
 In the next lines the callback onCellSelect can be called with the values and editCell can be called with ci=-1. It’s a bug.
I suggest to insert the line
1 |
td = $(td).closest("tr.jqgrow>td"); |
before call of $.jgrid.getCellIndex and to use if td.length > 0 as additional criteria in the code below.
The exact changes of jqGrid code can be seen here.
Best regards
Oleg
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top