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.

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
  • Changing theme in parent #77241

    OrchidDeveloper
    Participant

    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.

    Changing theme in parent #77248

    ivailo
    Participant

    Hi OrchidDeveloper,

    We tested your scenario and we can’t see this behavior.
    Here is a demo simulated your case.

    Best Regards,
    Ivailo Ivanov

    jQWidgets Team
    http://www.jqwidgets.com

    Changing theme in parent #77250

    OrchidDeveloper
    Participant

    Ivailo,
    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.

    Changing theme in parent #77271

    OrchidDeveloper
    Participant

    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.

    Changing theme in parent #77418

    OrchidDeveloper
    Participant

    Hi there,

    Any chance to get some feedback on this any time soon?

    Thanks.

    Changing theme in parent #77437

    ivailo
    Participant

    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 Ivanov

    jQWidgets Team
    http://www.jqwidgets.com

    Changing theme in parent #77467

    OrchidDeveloper
    Participant

    Hi 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.

    Changing theme in parent #77488

    ivailo
    Participant

    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 Ivanov

    jQWidgets Team
    http://www.jqwidgets.com

    Changing theme in parent #77536

    OrchidDeveloper
    Participant

    Thank you very much Ivailo.

    Your suggested workaround does the trick. I hope you address this bug in one of your future releases.

    Best regards.

Viewing 9 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.