jQWidgets Forums

jQuery UI Widgets Forums General Discussions Extend any class prototype

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

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • Extend any class prototype #15159

    rodo
    Member

    Hello,

    I would like to add a custom method ‘getSelectedValue’ to the jqxComboBox plugin.
    What I did is :

    (function ($) {
    $.extend($.jqx._jqxComboBox.prototype, {
    getSelectedValue: function () {
    var item = this.getSelectedItem();
    if (item != null) return item.value;
    return null;
    }
    });
    })(jQuery);

    I can see the method inside prototype in the debugger but I can’t call the method on a combo instance.

    $(‘#mycombo’).jqxComboBox(‘getSelectedValue’) and $(‘#mycombo’).getSelectedValue() don’t work.

    Any help would be greatly appreciated.
    Thanks in advance.

    Extend any class prototype #15181

    rodo
    Member

    My fault, sorry !

    Extend any class prototype #59099

    diegotroitino
    Participant

    What did you do to solve that?

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

You must be logged in to reply to this topic.