Hello,
Does anyone know how to change the title of a widget dynamically at runtime? I would like to prepend additional information after the existing title. For example if my widget title is "ABC" I would like to prepend "ABC: 123".
Thank You
Solved! Go to Solution.
Greg,
So if you want to change the widgets title from inside the widgets code you would use:
this.getPanel().titleLabelNode.innerHTML = "blah blah";
Greg,
This is thread is not for changing the widget title but the same exact principle applies:
Robert,
Thank you for responding. Yeah, that's not it. That changes the title of the title bar of the application. What I'm looking for is to change the title of the "widget" at runtime. Inside the widget path /nls/string.js I have the below. I am wanting to change the widgetTitle to My Widget: "SOME ADDITIONAL TEXT"
define({
root: {
widgetTitle: 'My Widget',
_featureAction_MyWidget: "My Widget",
description: 'A custom widget.'
}
// add supported locales below:
// , "zh-cn": true
});
Greg,
Yes, I guess you missed the part where I said the concept would be the same. You just have to do the proper query for the widgets title.
Greg,
So if you want to change the widgets title from inside the widgets code you would use:
this.getPanel().titleLabelNode.innerHTML = "blah blah";