Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id 3DB7EE00BA0; Tue, 29 Mar 2016 02:07:27 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high * trust * [134.134.136.65 listed in list.dnswl.org] Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id A5B70E00AE4 for ; Tue, 29 Mar 2016 02:07:24 -0700 (PDT) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga103.jf.intel.com with ESMTP; 29 Mar 2016 02:07:23 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,410,1455004800"; d="scan'208";a="773700670" Received: from meskola-mobl3.ger.corp.intel.com (HELO lp.ger.corp.intel.com) ([10.252.26.30]) by orsmga003.jf.intel.com with ESMTP; 29 Mar 2016 02:07:23 -0700 From: Elliot Smith To: toaster@yoctoproject.org Date: Tue, 29 Mar 2016 10:07:10 +0100 Message-Id: <1459242431-17140-2-git-send-email-elliot.smith@intel.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1459242431-17140-1-git-send-email-elliot.smith@intel.com> References: <1459242431-17140-1-git-send-email-elliot.smith@intel.com> Subject: [PATCH 1/2] toaster: ensure ToasterTable headings are reset when order by changes X-BeenThere: toaster@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Web based interface for BitBake List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Mar 2016 09:07:27 -0000 From: Michael Wood 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 Signed-off-by: Elliot Smith --- 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.