PDA

View Full Version : Multiple Drag and Drop Issue when updateIndex is called



daprathap
20 Dec 2012, 3:29 AM
When multiple drag drop is performed between two grids. It throws an error in the updateIndex method.
On closer inspection, ns length and records length is not the same. Actually the size of ns is greater than the size of records. Please note that this is happening occasionally.

updateIndexes : function(startIndex, endIndex) {
var ns = this.all.elements,
records = this.store.getRange(), i;
startIndex = startIndex || 0; endIndex = endIndex || ((endIndex === 0) ? 0 : (ns.length - 1));
// Length of ns doesn't match the length of the records
for (i = startIndex; i <= endIndex; i++)
{ ns[i].viewIndex = i;
ns[i].viewRecordId = records[i].internalId; // throws an error records[i] is undefined
if (!ns[i].boundView) { ns[i].boundView = this.id; } } }