Fix removing (delete) a row from nextmatch

- Fix broken destroy callback
- Fix caching & actions to be removed
- Fix always removing the last row also
- Fix indexing so arrow keys work over sparse indexMap
This commit is contained in:
Nathan Gray
2014-01-17 17:57:59 +00:00
parent 0c2d8f87b9
commit 344a63b37c
3 changed files with 39 additions and 6 deletions

View File

@ -152,6 +152,7 @@ var et2_dataview_selectionManager = Class.extend(
if (!_noDelete
&& this._registeredRows[_uid].state === EGW_AO_STATE_NORMAL)
{
delete this._indexMap[this._registeredRows[_uid].idx];
delete this._registeredRows[_uid];
}
@ -326,8 +327,16 @@ var et2_dataview_selectionManager = Class.extend(
}
function getElementRelatively (_step) {
return getIndexAO(Math.max(0,
Math.min(self._total - 1, _entry.idx + _step)));
var count = self._total;
var element = null;
var idx = _entry.idx;
while(element == null && count > 0 && idx <= self._total)
{
count--;
element = getIndexAO(Math.max(0,
Math.min(self._total - 1, idx += _step)));
}
return element;
};
_entry.ao.getPrevious = function (_step) {