jQWidgets Forums

jQuery UI Widgets Forums General Discussions Lists DropDownList selectionRenderer: Center Text vertically

This topic contains 1 reply, has 2 voices, and was last updated by  Nadezhda 10 years, 6 months ago.

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

  • badera
    Participant

    Dear jqWidgets Team

    What is the correct way to center an overriden Text in selectionRenderer of a DropDownList? – I wonder why just returning the input of selectionRenderer does not end up in the same behaviour as if we would not reprogramm selectionRenderer:

    Why does this change the vertical alignement compared if we would not have the selectionRenderer function reprogrammed?

    
    $('#jqxDropDownList').jqxDropDownList({selectionRenderer: function (htmlString) 
    {
        return htmlString;
    }
    });
    

    If it would behave the same, we could just exchange the innerHTML of htmlString with the own text. But I think it is not quite clean to set manually a fixed margin-top to get the centered alignement…

    So what is the clean way to have it centered vertically?
    Thanks in advance for your help!
    – badera

    selectionRenderer: Center Text vertically #66075

    Nadezhda
    Participant

    Hello badera,

    By using the ‘selectionRenderer’ function, you can customize the look of the selected item. The following example contains possible solution for vertically centered text in jqxDropDownList: http://jsfiddle.net/mxb8Ly3b/. We hope it is helpful to you.

    Best Regards,
    Nadezhda

    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.