Function for continous reloading a widget available

Hi,

I’m looking for a way to reload one of my own widget eg. each 15 seconds.

I’ve found an older javascript example:


$(this).parents('[widgetId]').dashboardWidget('reload');

But it seems, this isn’t working anymore in 2.x.

Thanks in advance
Joachim

Hi,

You should take a look into this file :
/plugins/Dashboard/javascripts/dashboardWidget.js

There is a reload function that should do the trick.

Hi Vincent,

thank you very much. So it seems I’m on the right way.

But I’m not so familiar with jQuery (SQL is my favorite).

Could you help me with the syntax (eg. my plugin is “myPlugin” and the widget is “myWidget”).

I’ve tried an uncountable number of combinations (like
[ul]
[li] $(this).parents(’[myWidget]’).dashboardWidget(‘reload’, false, true);
[/li][li] $(this).parents(’[myPluginmyWidget]’).dashboardWidget(‘reload’, false, true);
[/li][li] $(this).parents(’[widgetmyPluginmyWidget]’).dashboardWidget(‘reload’, false, true);
[/li][/ul]

But none of these are working :frowning:

Hi,

I’ve got some external help, so now I know how to call the reload (and forget all the other docs):


$('[widgetid=widgetmyPluginmyWidget]').dashboardWidget('reload', false, true);

The widget Id is “widget” + “Name-of-your-plugin” + “Name-of-your-widget”

Cheers
Joachim