mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 06:11:37 +00:00
Fixing slowness of trees. We now don't sort on get cell text, we only sort before adding the view, and after they click on the tree to sort.
This commit is contained in:
parent
4e9b0249fd
commit
9ee2b36afb
@ -516,15 +516,6 @@ var treeView =
|
||||
setTree : function( tree ){this.tree = tree;},
|
||||
getCellText : function(row,column)
|
||||
{
|
||||
var columnElement = document.getElementById(column);
|
||||
var sortActive = columnElement.getAttribute("sortActive");
|
||||
if (sortActive == "true")
|
||||
{
|
||||
this.selectedColumn = column;
|
||||
this.sortDirection = columnElement.getAttribute("sortDirection");
|
||||
gEventArray.sort(sortEvents);
|
||||
}
|
||||
|
||||
calendarEvent = gEventArray[row];
|
||||
var calendarStringBundle = srGetStrBundle("chrome://calendar/locale/calendar.properties");
|
||||
switch( column )
|
||||
@ -641,6 +632,18 @@ function refreshEventTree( eventArray )
|
||||
|
||||
treeView.rowCount = gEventArray.length;
|
||||
|
||||
var ArrayOfTreeCols = document.getElementById( UnifinderTreeName ).getElementsByTagName( "treecol" );
|
||||
for( var i = 0; i < ArrayOfTreeCols.length; i++ )
|
||||
{
|
||||
if( ArrayOfTreeCols[i].getAttribute( "sortActive" ) == "true" )
|
||||
{
|
||||
treeView.selectedColumn = ArrayOfTreeCols[i].getAttribute( "id" );
|
||||
treeView.sortDirection = ArrayOfTreeCols[i].getAttribute("sortDirection");
|
||||
gEventArray.sort(sortEvents);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
document.getElementById( UnifinderTreeName ).view = treeView;
|
||||
|
||||
document.getElementById( UnifinderTreeName ).eventView = new calendarEventView( eventArray );
|
||||
|
@ -400,15 +400,6 @@ var toDoTreeView =
|
||||
setTree : function( tree ){this.tree = tree;},
|
||||
getCellText : function(row,column)
|
||||
{
|
||||
var columnElement = document.getElementById(column);
|
||||
var sortActive = columnElement.getAttribute("sortActive");
|
||||
if (sortActive == "true")
|
||||
{
|
||||
this.selectedColumn = column;
|
||||
this.sortDirection = columnElement.getAttribute("sortDirection");
|
||||
gTaskArray.sort(sortTasks);
|
||||
}
|
||||
|
||||
calendarToDo = gTaskArray[row];
|
||||
if( !calendarToDo )
|
||||
return;
|
||||
@ -511,6 +502,19 @@ function refreshToDoTree( taskArray )
|
||||
|
||||
toDoTreeView.rowCount = gTaskArray.length;
|
||||
|
||||
var ArrayOfTreeCols = document.getElementById( UnifinderTreeName ).getElementsByTagName( "treecol" );
|
||||
|
||||
for( var i = 0; i < ArrayOfTreeCols.length; i++ )
|
||||
{
|
||||
if( ArrayOfTreeCols[i].getAttribute( "sortActive" ) == "true" )
|
||||
{
|
||||
treeView.selectedColumn = ArrayOfTreeCols[i].getAttribute( "id" );
|
||||
treeView.sortDirection = ArrayOfTreeCols[i].getAttribute("sortDirection");
|
||||
gTaskArray.sort(sortTasks);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
document.getElementById( ToDoUnifinderTreeName ).view = toDoTreeView;
|
||||
|
||||
document.getElementById( ToDoUnifinderTreeName ).taskView = new calendarTaskView( gTaskArray );
|
||||
|
Loading…
Reference in New Issue
Block a user