Fixed: removeTableColumn does not removes column from tableColumns array

Previously the tableView didn't correctly remove a given tableColumn. It was removed in the method load (who is called by the layoutSubviews).
Now the tableColumns is removed before the layoutSubviews (as in cocoa).
It fixed also another problem, before this fixe it wasn't possible to remove all of the columns of a tableView (the last column was always displayed). This is fixed also

Fixes #1913

You can test that with the app of t00f
This commit is contained in:
Alexandre Wilhelm committed 2013-05-31 16:11:11 -07:00
1 parent 295443f2e3
commit 3b48aafe66
1 file changed
+21 -15
+21 -15
View File
@@ -1044,6 +1044,9 @@ NOT YET IMPLEMENTED
else
_dirtyTableColumnRangeIndex = MIN(index, _dirtyTableColumnRangeIndex);
[_tableColumns removeObject:aTableColumn];
_reloadAllRows = YES;
[self setNeedsLayout];
}
@@ -3459,6 +3462,24 @@ Your delegate can implement this method to avoid subclassing the tableview to ad
[self setNeedsDisplay:YES];
// if we have any columns to remove do that here
if ([_differedColumnDataToRemove count])
{
for (var i = 0; i < _differedColumnDataToRemove.length; i++)
{
var data = _differedColumnDataToRemove[i],
column = data.column,
tableColumnUID = [column UID],
dataViews = _dataViewsForTableColumns[tableColumnUID];
for (var j = 0; j < [dataViews count]; j++)
{
[self _enqueueReusableDataView:[dataViews objectAtIndex:j]];
}
}
[_differedColumnDataToRemove removeAllObjects];
}
// Now clear all the leftovers
// FIXME: this could be faster!
for (var identifier in _cachedDataViews)
@@ -3469,21 +3490,6 @@ Your delegate can implement this method to avoid subclassing the tableview to ad
while (count--)
[dataViews[count] removeFromSuperview];
}
// if we have any columns to remove do that here
if ([_differedColumnDataToRemove count])
{
for (var i = 0; i < _differedColumnDataToRemove.length; i++)
{
var data = _differedColumnDataToRemove[i],
column = data.column;
[column setHidden:data.shouldBeHidden];
[_tableColumns removeObject:column];
}
[_differedColumnDataToRemove removeAllObjects];
}
}
/*!