Ticket #6351 (new defect)
_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