Change Widget Description
Apologies if I've missed it, but has anyone written js for changing the Description section of a widget? It's the same section of a widget where the edit pencil appears. I would like to change the font color, size, ...
danblack
Posted 2 years ago·Last reply 2 years ago
9 comments
danblack
OP2 years agoThank you JeremyFriedel!
And also for your help, DRay!
Jeremy Friedel
·2 years agoHi danblack
Based on the existing script shared at the start of the thread, the below code will only run on the current widget, as it includes the Widget unique OID to the CSS selector, narrowing the scope to the current widget.
The code can be changed as needed, as long as the Widget OID is kept in the CSS selector (in this case used with jQuery), the styling will only be for the current widget.
DRay
·2 years agoHi danblack,
I am going to reach out to your account team. We will find a technical resource to work with you directly.
danblack
OP2 years agoHey DRay how would I incorporate the widget id-specific code within my code? And should it be placed at the dashboard level or widget level? I'd like it to work for all widgets, but it does nothing when I use it (as it is) at the dashboard level.
DRay
·2 years agoHi danblack,
Good to see you again! You may need to target the specific widget by using the Widget ID. For example, if you wanted to change the background color you could use the following:
var widgetId = 'widget[widgetid*=' + sender.oid + ']';
$(widgetId + ' .p-value').css('background-color','rgb(0,114,206)');
danblack
OP2 years agoHey, DRay! Good to see you again as well!
Wondering if you might know why this would be... I'm actually happy with the code, but when a user (viewer) looks at the dashboard, the Description title changes don't seem to be working. Yet, it looks fine on my end.
DRay
·2 years agoThat is odd. I wonder if the Widget ID is different.
danblack
OP2 years agoDRay
I'm not specifying a widget ID. The code is actually as shown above; I hadn't made any changes.
danblack
OP2 years agoFWIW, I was able to manipulate the following code. The only issue is that it changes the description for all widgets + dashboard when placed in a widget's editor. It does nothing when placed in the dashboard's editor.