Opened 10 years ago

Closed 9 years ago

#15278 closed defect (patchwelcome)

onStartEdit() event on a non-editable cell

Reported by: helloworld Owned by: Evan
Priority: undecided Milestone: tbd
Component: DojoX Grid Version: 1.7.2
Keywords: Cc:
Blocked By: Blocking:


One case here:

  1. click &change the cell value of grid(don't move mouse out of this row)
  2. click another cell, which is not editable, of the same row
  3. grid will call _editmanager.setEditCell(), then call _editmanager.start() on this cell.

Wrong result: as you know, this cell is not editable, so should not call any start() on it, right?

because this _editmanager.start() will trigger onStartEdit(), unfortunately, our project binded this onStartEdit(), so wrong things happened.

patch: I have found the suspected code below, and have a change for it. Since I am not familiar with datagrid code, could someone confirm whether any side effect for this hot patch?

dojox\grid\_EditManager.js from line#258 <raw>

setEditCell: function(inCell, inRowIndex){

summary: Set the given cell to be edited inRowIndex: Integer Grid row index inCell: Object Grid cell object if(!this.isEditCell(inRowIndex, inCell.index) && this.grid.canEdit && this.grid.canEdit(inCell, inRowIndex)){

this.start(inCell, inRowIndex, this.isEditRow(inRowIndex)




for line: from <raw>

this.start(inCell, inRowIndex, this.isEditRow(inRowIndex)

</raw> to: <raw> this.start(inCell, inRowIndex, inCell.editable); </raw>

I just removed "this.isEditRow(inRowIndex)".

Since no matter this row is editing or not, only if this cell is editable, then click this cell will edit it; if this cell is not editable, this cell will not edit even this row is editing and click this non-editable cell. Right?


Change History (3)

comment:1 Changed 10 years ago by helloworld

Sorry, due to the format error, the original code is:

this.start(inCell, inRowIndex, this.isEditRow(inRowIndex) || inCell.editable);

the fixed code is:

this.start(inCell, inRowIndex, inCell.editable);
Last edited 10 years ago by helloworld (previous) (diff)

comment:2 Changed 9 years ago by bill

DojoX Grid and EnhancedGrid are deprecated in favor of dgrid and gridx.

You should upgrade your code to use one of those two grids.

We will consider patches to the old DojoX Grid code though.

comment:3 Changed 9 years ago by bill

Resolution: patchwelcome
Status: newclosed
Note: See TracTickets for help on using tickets.