Opened 12 years ago

Closed 11 years ago

#6491 closed defect (fixed)

deleting an item at the end of a grid with fast scrolling enabled errors

Reported by: guest Owned by: Bryan Forbes
Priority: high Milestone: 1.2
Component: DojoX Grid Version: 1.1.0
Keywords: grid item delete Cc:
Blocked By: Blocking:

Description

Fast scrolling allows the grid to fetch non incremental pages of data. If I have a datastore with enough data, I can move the scroll bar to the bottom and it will fetch the last page without fetching other pages above it. This means the model.data array will contain "undefined" entries above the last page that was fetched. When I then delete one of the rows, the model gets the "onDelete" event and calls _storeDatumDelete which in turn calls _removeItems. model._removeItems attempts to rebuild the _rowIdentities by iterating through the model.data array. It doesn't check if the model.data array entries are actual objects or undefined and when trying to get the dojo_data_item and consequently fails.

The model._removeItems method should be changed to look like this...

_removeItems: function(inRowIndexes){

dojox.grid.data.Dynamic.prototype.remove.apply(this, arguments); Rebuild _rowIdentities this._rowIdentities = {}; for (var i = 0; i < this.data.length; i++){

var data = this.data[i]; if ( data ) this._setRowId(data.dojo_data_item, 0, i);

}

}

Change History (2)

comment:1 Changed 12 years ago by dylan

Milestone: 1.2
Owner: changed from sorvell to Bryan Forbes

comment:2 Changed 11 years ago by Bryan Forbes

Resolution: fixed
Status: newclosed

No longer an issue in the 1.2 grid.

Note: See TracTickets for help on using tickets.