From 6e42070d8abc80dacd8094c4f5019577453a9d49 Mon Sep 17 00:00:00 2001 From: Michael Wood Date: Tue, 27 Oct 2015 19:11:01 +0000 Subject: [PATCH] toaster: tablejs Add an event handler to manually trigger a data reload Allow users of ToasterTable to manually trigger a refresh of the data. This can be useful if an action has happened in-page and the data is now invalid. Such as new data being added or removed from the model. Signed-off-by: Michael Wood Signed-off-by: brian avery --- lib/toaster/toastergui/static/js/table.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/toaster/toastergui/static/js/table.js b/lib/toaster/toastergui/static/js/table.js index 87cac600a59..a7e4fbad09a 100644 --- a/lib/toaster/toastergui/static/js/table.js +++ b/lib/toaster/toastergui/static/js/table.js @@ -671,6 +671,13 @@ function tableInit(ctx){ }); } + /* Allow pages to trigger reload event */ + table.on('reload', function(e, newTableParams){ + if (newTableParams) + loadData(newTableParams); + else + loadData(tableParams) + }); $(".get-help").tooltip({container:'body', html:true, delay:{show:300}}); -- 2.47.3