How may you conditionally hide widget(s) on a dashboard?
I'd like to know if there's any way to conditionally hide a widget?
e.g. If the widget pulls no data at all, what methods are available for hiding that widget?
I'd prefer a method with the widget does not leave a section of whitespace on the dashboard and widgets that appear, fill up the excess space on the row when widgets become hidden.
-
From a widget script you can use jquery to grab the widget by id
$(''widget[widgetid="5da0d06b90d3ba21585bad2d"]')
You can call the hide method on the widget to hide it from the dashboard.You need to add this hook to the widget when it is processing the query results and check the query results to see whether or not you should hide the widget.
-
Thanks Nathan Giusti
That worked; however, it leaves all the whitespace from that widget on the dashboard.
Please sign in to leave a comment.
Comments
3 comments