jQWidgets Forums

jQuery UI Widgets Forums Lists DropDownList Usage of "selectionRenderer"

This topic contains 1 reply, has 2 voices, and was last updated by  Dimitar 12 years, 7 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • Usage of "selectionRenderer" #10460

    binfch
    Participant

    Hi there

    What is the correct usage of “selectionRenderer” in a jqxDropDownList?

    I tried to assign some HTML to “htmlString”, dut that does not seem to work.

      var listInputMode = [
    "Text",
    "Mask",
    "Voice"
    ];
    $("#inputMode").jqxDropDownList({
    width: 65,
    height: 24,
    autoDropDownHeight: true,
    theme: 'classic',
    source: listInputMode,
    autoOpen: false,
    selectedIndex: 1,
    selectionRenderer: function (htmlString) {
    return '<div style="position: relative; margin-left: 3px; margin-top: 5px;">' + htmlString + '</div>';
    }
    });

    Thanks & cheers,
    Peter

    Usage of "selectionRenderer" #10520

    Dimitar
    Participant

    Hello binfch,

    Here is how to get the selected element’s string and use it in the selectionRenderer callback function:

                        selectionRenderer: function (htmlElement) {
    var htmlString = htmlElement[0].innerHTML;
    return '<div style="position: relative; margin-left: 3px; margin-top: 5px;">' + htmlString + '</div>';
    }

    Best Regards,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com

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

You must be logged in to reply to this topic.