Opened 9 years ago

Closed 6 years ago

#11878 closed defect (patchwelcome)

doApplyCellEdit : _by_idx[inRowIndex] is undefined

Reported by: nsharrok Owned by: Bryan Forbes
Priority: high Milestone: tbd
Component: DojoX Grid Version: 1.5
Keywords: doApplyCellEdit Cc:
Blocked By: Blocking:


I get _by_idx[inRowIndex] is undefined error in FF and IE after deleting rows on a DataGrid? that has onApplyEdit set. onApplyEdit = "updateData"

The row/s selected has a cell that is in Edit mode when the rows are deleted.

When a remaining row cell is clicked the error occurs. The inRowIndex is the idx of a deleted row.

I fixed this for my self by adding the following to DataGrid?.js doApplyCellEdit: function(inValue, inRowIndex, inAttrName){ if (typeof(this._by_idx[inRowIndex])=="undefined") return;{....

The onApplyEdit callback function is called with the bad row index.

function updateData(rowIndex) {

var i = grid.getItem(rowIndex); if (i == null) return; row has already been deleted ....

This is a hack to get me out of a hole. I haven't found a way to Cancel the Edit before the deletion that worked in this instance

Change History (6)

comment:1 Changed 9 years ago by bill

Component: GeneralDojoX Grid
Owner: changed from anonymous to bryanforbes

comment:2 Changed 9 years ago by soularis999

I have the same problem. I think I narrowed it down to _EditManager.js (as in grid.edit) still keeping the edit info object available after you delete the row. After further investigation I saw that when _View.js "rowRemoved" method is called it is internally using _EditManager.js with call to, inRowIndex);

that is supposed to remove the row from edit state if it is been removed. However in _EditManager.js the method signature is

save: function(inRowIndex, inView){ }

The parameters passed are in wrong order.

comment:3 Changed 9 years ago by bill

Owner: changed from bryanforbes to Bryan Forbes

comment:4 Changed 8 years ago by mave2k3

I've the same error with the DataGrid? without idAttribute given to the store, with given id attribute there is no error and everything works perfectly. Looks like there is a problem with generating the id when none is given to the store.

comment:5 Changed 6 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:6 Changed 6 years ago by bill

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