jQWidgets Forums

jQuery UI Widgets Forums Lists DropDownList Unwanted space on jqxdropdownlist value

This topic contains 4 replies, has 2 voices, and was last updated by  Peter Stoev 11 years, 6 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
  • Unwanted space on jqxdropdownlist value #33066

    tompasto
    Participant

    I populate a jxqdropdownlist using a dataAdapter source:

    $(document).ready(function() {

    var source =
    {
    datatype: “json”,
    datafields: [
    { name: ‘ID’},
    { name: ‘SESSION_NAME’},
    { name: ‘SESSION_START’},
    { name: ‘SESSION_STOP’}
    ],
    url: ‘data/query.php’,
    async: false

    };
    var dataAdapter = new $.jqx.dataAdapter(source);

    $(“#session”).jqxDropDownList({ source: dataAdapter, selectedIndex: 0, height: ’25px’, theme: ‘Salud’, displayMember:’SESSION_NAME’, valueMember:’SESSION_NAME’ });

    });

    The query PHP return correctly the json value (here what it is return):
    [{“ID”:”23″,”SESSION_NAME”:”Automne-2013 “,”SESSION_START”:”2013-08-26″,”SESSION_STOP”:”2013-12-06″}]

    When i try to get the value of my dropdown list i have space after my value result.
    I use Google Chrome debugger to inspect element and i see that the input that is create got unwanted space on value:

    Any idea bout this behaviour ?

    Unwanted space on jqxdropdownlist value #33071

    Peter Stoev
    Keymaster

    Hi tompasto,

    How do you get the value? By using the item’s value member?

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Unwanted space on jqxdropdownlist value #33092

    tompasto
    Participant

    hello,
    I get the value with $(“#session”).jqxDropDownList(‘getItems’).value
    Also on inspecting element with google chrome debugger i see:

    Unwanted space on jqxdropdownlist value #33094

    tompasto
    Participant

    sorry i see space on the input value in the debugger

    Unwanted space on jqxdropdownlist value #33107

    Peter Stoev
    Keymaster

    Hi tompasto,

    It seems that there is a space in the provided data. See your post’s code – Automne-2013 and a space after it.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

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

You must be logged in to reply to this topic.