Ticket #6351 (new defect)

Opened 4 months ago

Last modified 2 weeks ago

_getRowId() in dojox.grid.data.DojoData needs to check for existence of _rowIdentities entry

Reported by: guest Owned by: sorvell
Priority: normal Milestone: tbd
Component: DojoX Grid Version: 1.0
Severity: normal Keywords:
Cc: sschaer@…

Description

When used with an identiy capable store (eg ItemfileWriteStore?) data.DojoData?._getRowId() causes a 'nullpointer' upon updating items in the store that have not been loaded by the Grid yet.

Cause: data.DojoData?._getRowId() does a:

rowId = this._rowIdentities[this.store.getIdentity(item)].rowId;

without prior checking whether the entry in _rowIdentities already exists. This is not the case if the row has not been populated by the Grid yet.

Fix:

Simply check whether the entry exists in _rowIdenties prior to accessing .rowId.

Something like: rowId = this._rowIdentities[this.store.getIdentity(item)];

if(rowId)

rowId = rowId.rowId;

(Sorry for not providing a patch but 1, its such a simple fix 2, someone with more indepth knowledge of the code and understanding of the internals of data.DojoData? will have to check this anyways.

Regards,

Sebastian

Change History

Changed 2 weeks ago by bill

  • milestone set to tbd

mark all (open) tickets w/blank milestones to be "tbd"; their milestones need to be set to a version number or to "future"

Note: See TracTickets for help on using tickets.