bitbake: toaster: edit column list not sorted

The list of columns in the many 'Edit Columns' pop-ups became unsorted
with the 'Toaster Table' implementation. These entries need to be
gathered and sorted in the column processing.

[YOCTO #12004]

(Bitbake rev: d06a8ff74be11e4315feac6768064355ec15611f)

Signed-off-by: David Reyna <David.Reyna@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
David Reyna 2017-09-03 21:02:23 -07:00 committed by Richard Purdie
parent 8ef614ee77
commit 17b4f4e731
1 changed files with 10 additions and 1 deletions

View File

@ -202,6 +202,7 @@ function tableInit(ctx){
}
/* Add table header and column toggle menu */
var column_edit_entries = [];
for (var i in tableData.columns){
var col = tableData.columns[i];
if (col.displayable === false) {
@ -293,9 +294,17 @@ function tableInit(ctx){
defaultHiddenCols.push(col.field_name);
}
editColMenu.append(toggler);
/* Gather the Edit Column entries */
column_edit_entries.push({'title':col.title,'html':toggler});
} /* End for each column */
/* Append the sorted Edit Column toggler entries */
column_edit_entries.sort(function(a,b) {return (a.title > b.title) ? 1 : ((b.title > a.title) ? -1 : 0);} );
for (var col in column_edit_entries){
editColMenu.append(column_edit_entries[col].html);
}
tableChromeDone = true;
}