New to Kendo UI for jQueryStart a free 30-day trial

MultiSelect Performs Repetitive Requests while Filtering

Environment

ProductProgress® Kendo UI® MultiSelect for jQuery
Operating SystemWindows 10 64bit

Description 

The MultiSelect performs repetitive requests while filtering in ASP.NET.

Cause

Repetitive requests that are performed by the Kendo UI MultiSelect component are caused by the response from the ASP.NET Web API Order controller.

Solution

The total configuration has to respond to the total number of records that are found after filtering, that is, dataResult.Count. Otherwise, the widget continues to request the remainder of the total.

The following example demonstrates how to change the service accordingly.

js
   public object Get(int? take = null, int? skip = null, string q = null)
    {
    	List<OrderModel> dataResult = string.IsNullOrEmpty(q) ? Orders.Skip(skip ?? 0).Take(take ?? int.MaxValue).ToList() : Orders.Where(m => m.Name.Contains(q)).ToList();
    	return new
    	{
    		total = dataResult.Count,
    		data = dataResult
    	};
    }

See Also