jQWidgets Forums
jQuery UI Widgets › Forums › Gauges and Maps › Gauges › Changing theme in parent
This topic contains 8 replies, has 2 voices, and was last updated by OrchidDeveloper 9 years, 6 months ago.
-
AuthorChanging theme in parent Posts
-
Hi there,
I have found an issue with your jqxGauge widget.
When jqxGauge is hosted by some other widget (e.g. jqxPanel, splitter, etc), changing the host’s theme property calls setTheme() for all child element, which causes exception when jqxGauge element is processed.
This is because jqxGauge has a child with className set to SVGAnimatedString. SVGAnimatedString doesn’t have splice() method and this is what causes the exception.I understand that you may or may not fix this in next release, but could you please at least suggest some workaround?
Thanks in advance.
Hi OrchidDeveloper,
We tested your scenario and we can’t see this behavior.
Here is a demo simulated your case.Best Regards,
Ivailo IvanovjQWidgets Team
http://www.jqwidgets.comIvailo,
Thank you for quick response.You are right, the demo sample you provided doesn’t throw any exception. The only thing is that your sample is using jQuery v1.10 and I am using v1.11.3, but I don’t see how this could break it.
I’ll try to simplify the code here to see if it makes any difference. Will get back to this thread if I find the cause.
Regards.
PS
Great stuff these widgets by the way.Hello Ivailo,
I was able to create a minimal html/javascript code to demonstrate the issue. Please refer to the following jsFiddle
https://jsfiddle.net/ezbLccu0/2/The gauge is inside navigation bar, which is inside a splitter.
Regards.
Hi there,
Any chance to get some feedback on this any time soon?
Thanks.
Hi OrchidDeveloper,
You have to initialize jqxGauge in initContent callback of your NavigationBar.
Some of the widgets have this callback, so you have to use it to prevent problems.Best Regards,
Ivailo IvanovjQWidgets Team
http://www.jqwidgets.comHi Ivailo,
Unfortunately, your suggestion doesn’t work. I have updated the original jsFiddle, so you can see it yourself.
By the way, as I mentioned in my first post, the origin of this TypeError is in setTheme() function (file: jqxcore.js, line: 886). There you are trying to split className of DOM element.
var classNames = element[0].className.split(' ')
In case of jqxGauge (or jqxChart) widget, one of child elements has SVGAnimatedString object as className and it doesn’t have split() method.If you still think initialising jqxGauge in initContent callback will solve this problem, kindly provide a jsFiddle that demonstrates this.
Regards.
Hi OrchidDeveloper,
Like a workaroud try to detach the widget until the theme is changing an then to return it again.
Here is the demo.Best Regards,
Ivailo IvanovjQWidgets Team
http://www.jqwidgets.comThank you very much Ivailo.
Your suggested workaround does the trick. I hope you address this bug in one of your future releases.
Best regards.
-
AuthorPosts
You must be logged in to reply to this topic.