[Toaster] [PATCH 1/2] toaster: ensure ToasterTable headings are reset when order by changes
Elliot Smith
elliot.smith at intel.com
Tue Mar 29 02:07:10 PDT 2016
From: Michael Wood <michael.g.wood at intel.com>
If a ToasterTable is ordered by an optional column and that
column is subsequently hidden, the table ordering switches back
to the default ordering for the table. However, the table headings
don't update to reflect the new ordering. This is because the
code which sets the heading weight and hides/shows the caret symbols
only runs when the table is first loaded.
Store the default order by and re-apply it when the data is updated.
[YOCTO #9011]
Signed-off-by: Michael Wood <michael.g.wood at intel.com>
Signed-off-by: Elliot Smith <elliot.smith at intel.com>
---
bitbake/lib/toaster/toastergui/static/js/table.js | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/bitbake/lib/toaster/toastergui/static/js/table.js b/bitbake/lib/toaster/toastergui/static/js/table.js
index a7e4fba..b2a7d59 100644
--- a/bitbake/lib/toaster/toastergui/static/js/table.js
+++ b/bitbake/lib/toaster/toastergui/static/js/table.js
@@ -232,6 +232,10 @@ function tableInit(ctx){
}
}
+ if (col.field_name === tableData.default_orderby){
+ title.addClass("default-orderby");
+ }
+
} else {
/* Not orderable */
header.css("font-weight", "normal");
@@ -377,7 +381,7 @@ function tableInit(ctx){
if (col === tableParams.orderby ||
'-' + col === tableParams.orderby){
tableParams.orderby = null;
- loadData(tableParams);
+ $("#"+ctx.tableName +" .default-orderby").click();
}
}
--
Elliot Smith
Software Engineer
Intel OTC
---------------------------------------------------------------------
Intel Corporation (UK) Limited
Registered No. 1134945 (England)
Registered Office: Pipers Way, Swindon SN3 1RJ
VAT No: 860 2173 47
This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
More information about the toaster
mailing list