From: Michael Wood Date: Tue, 27 Oct 2015 19:11:01 +0000 (+0000) Subject: toaster: tablejs Add an event handler to manually trigger a data reload X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6e42070d8abc80dacd8094c4f5019577453a9d49;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git 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 --- 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}});