Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Kendo UI Multiselect

Tags:

kendo-ui

I've been using the new Kendo UI Multiselect widget with server-side filtering, but I'm having trouble getting it to only make the ajax call after a minimum number of characters have been entered. I've set the autoBind and minLength options to false and 3 respectively. However it sends an ajax request to get the select options as soon as I put my cursor into the text field. It does wait until 3 characters (or more) are entered before sending another ajax request and refreshing the options list. But how do I make it wait until 3 characters have been entered before the first ajax request is sent? Here is how I've configured the the multiSelect:

  $('#delegates').kendoMultiSelect(
        {
            autoBind: false,
            minLength: 3,
            placeholder: 'Select delegates...',
            dataTextField: 'name',
            dataValueField: 'personid',
            filter: 'contains',
            delay: 200,
            dataSource: {
                serverFiltering: true,
                transport: {
                    read: {
                        url: '/my/remote/url',
                        dataType: 'json'
                    }
                }
            }
        }
    );

I've looked at the overview and API docs for the MultiSelect widgets on the KendoUI site and it doesn't even appear that there's a way to do what I'm talking about (I initially thought the autoBind: false and minLength: 3 would be my answer, but turns out it's not). So I"m posting in the hopes that maybe I've missed something. Thanks in advance.

like image 936
tonyg Avatar asked Nov 13 '22 08:11

tonyg


1 Answers

$("#products").kendoMultiSelect({
                        placeholder: "Select products...",
                        dataTextField: "name",
                        dataValueField: "id",
                        autoBind: false,
                        dataSource: {
                            transport:{
                                read:{
                                    url:'products/api/get',
                                    serverPaging:true,
                                    pageSize:20,
                                    contentType:'application/json; charset=utf-8',
                                    type:'GET',
                                    dataType:'json'
                                }
                            }
                        }
                    });
like image 196
Somwang Souksavatd Avatar answered Dec 15 '22 17:12

Somwang Souksavatd