2

I am wondering if there's an easy way to have the multiselect widget's css functionality shown in this demo

http://demos.kendoui.com/web/multiselect/index.html

applied to an autocomplete widget.

user1221271
  • 65
  • 4
  • 10
  • Why not using multiselect? What are you looking from autocomplete that you miss in multiselect? – OnaBai Dec 04 '13 at 18:22
  • 2
    i chose autocomplete widgets for those input fields that are bound to a datasource with many data items (several thousands). So in this case the user types the first (i.e.) 3 letters and the datasource is filtered according to his input. – user1221271 Dec 04 '13 at 19:17

1 Answers1

0

If the only reason for using autocomplete is that the list of values is huge and you want to do server side filtering (serverFiltering) with a multiselect widget as well. You just need to define serverFiltering as true.

Example:

var ds = new kendo.data.DataSource({
    transport: {
        read: {
            url : "getData.php"
        }
    },
    serverFiltering: true
});

$("#items").kendoMultiSelect({
    dataValueField: "name",
    dataTextField : "name",
    dataSource    : ds
});

You will receive a some additional parameters saying what the user has typed so far and you server can return only the data that meets the condition.

This JSFiddle (http://jsfiddle.net/OnaBai/rpDuL/) tries to show you how it works. You can start typing a country name and see that it actually filters the data. Since this is just JavaScript I've simulated server filtering implementing a read function that greps the data for those records meeting the condition.

OnaBai
  • 40,767
  • 6
  • 96
  • 125
  • i apologize for not checking really carefully the multiselect documentation. thanks a lot. One more question, for the record: why someone choose multi-autocomplete functionality instead of multiselect? What more does it offer (except from the different css functionality)? – user1221271 Dec 05 '13 at 11:39
  • Not sure maybe some historical question, first there was AutoComplete, then AutoComplete with multiple options and finally MultiSelect. Also, typically (not sure if mandatory) AutoComplete is mapped in an HTML `input` and MultiSelect in `select` – OnaBai Dec 05 '13 at 12:33