jQuery UI Widgets Forums Gauges and Maps Gauges generic method to set jqWidgets value?

Tagged: , ,

This topic contains 2 replies, has 2 voices, and was last updated by  stko 9 years, 5 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • generic method to set jqWidgets value? #74842

    stko
    Participant

    Hi
    following problem:
    I’m going to use different type of widgets on a page. They shall get new values from a backend with supplies the data by a string identifier + the new value.

    during the initialisation I save the object references in an array:
    (simplified)

    myelements[nameIdentifier]=$('#gaugeContainer').jqxGauge({...});

    When then new data comes in, I can update the objects with

    $(myelements[nameIdentifier]).jqxGauge('value',newValue);

    or equivalent

    $(myelements[nameIdentifier])["jqxGauge"]('value',newValue);

    But my big problem is, that the constructor name which I have to use (“jqxGauge”) is Widget depending, so all this works only for one type of widget 🙁

    And I couldn’t find any hint so far how else I could create this call without this class name dependency to make it work for all jqWidget classes (means at least the ones which support to set their value).

    Does anybody has an idea how this could work or is it not possible by design?

    many thanks in advance

    regards
    Steffen

    generic method to set jqWidgets value? #74856

    ivailo
    Participant

    Hi stko,

    You can use val method. It’s common for the most of the widgets.

    Best Regards,
    Ivailo Ivanov

    jQWidgets Team
    http://www.jqwidgets.com

    generic method to set jqWidgets value? #74886

    stko
    Participant

    Dammed, it works! You made my day – many thanks! 🙂

    regards
    Steffen

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

You must be logged in to reply to this topic.