jQuery UI Widgets Forums Lists ComboBox Combobox autocomplete with multiple words

This topic contains 3 replies, has 2 voices, and was last updated by  Hristo 1 year, 9 months ago.

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

  • Pietervk
    Participant

    Hi, I have a strange issue with autocomplete. My list contains first and last names separate by a space.

    John Frankinson
    Pete Johnson
    Clair Franklyn

    If you start typing “Jo”, the autocomplete will select Pete Johnson and highlight Jo from the last name. Even when you type “John “, it will not select John Frankinson. In fact the autocomplete only works on the last name, it never selects anything from the first word in the list.

    This is my code:

     
               var source =
                {
                    datatype: "json",
                    datafields: [
                        { name: 'ClientName' },
                        { name: 'ClientId' }
                    ],
                    url: url,
                    async: true
                };
            var dataAdapter = new $.jqx.dataAdapter(source);
            // Create a jqxComboBox
            $("#jqxClientName").jqxComboBox({
                 selectedIndex: 0, 
                 theme: 'energyblue', 
                 autoComplete: true, 
                 searchMode: 'containsignorecase', 
                 source: dataAdapter, 
                 displayMember: 'ClientName', 
                 valueMember: 'ClientId', 
                 width: 200, 
                 height: 25
            });

    I also tried searchMode: ‘startswithignorecase’. This also only matches the last name, not the first.

    Any suggestions please?


    Hristo
    Participant

    Hello Pietervk,

    I tested this example and it seems to work fine.
    Could you clarify is there any error message?

    Best Regards,
    Hristo Hristov

    jQWidgets team
    http://www.jqwidgets.com

    • This reply was modified 1 year, 9 months ago by  Hristo.

    Pietervk
    Participant

    Hi Hristo,
    Thanks for the example.
    there is no error message, it just select the second word, it skips all that just match the first word, unlike your example. Perhaps it has to do with the datasource?

    Best regards

    Pieter


    Hristo
    Participant

    Hello Pietervk,

    In my example I implement autoComplete: true it demonstrates the items that match the searched text.
    And for the search mode is searchMode: 'containsignorecase'.

    Best Regards,
    Hristo Hristov

    jQWidgets team
    http://www.jqwidgets.com

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

You must be logged in to reply to this topic.