This is a migrated thread and some comments may be shown as answers.

Disable server filtering on keypress

9 Answers 635 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jakub
Top achievements
Rank 1
Jakub asked on 25 Jan 2016, 05:58 PM

Hello,

 I encountered problem with server side filtering. My datatabase table have like 100k rows. Iam presenting this 100k rows in kendoGrid using server filtering, paging and sorting. The problem is that whenever I type a single letter into filter input then grid makes a call to WebApi. Then again I type second letter then again call to WebApi is made. The problem is performance. I dont want grid to be calling my WebApi each letter. Is it possible to turn it off and make that only when I will unfocus input or click key Enter then the datasource.read() will be called?

9 Answers, 1 is accepted

Sort by
0
Alexander Valchev
Telerik team
answered on 27 Jan 2016, 12:53 PM
Hello Jakub,

It is unclear which type of filtering you are using. Could you please provide the relevant configuration so I can examine how the Grid is configured and assist you further?

Looking forward to your reply.

Regards,
Alexander Valchev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Jakub
Top achievements
Rank 1
answered on 27 Jan 2016, 02:34 PM

http://dojo.telerik.com/IFADi

 

Each time I type letter into filter input dataSource calls read method. I like to prevent that and make it only happen when I type enter or I will unfocus the filter.

Second question is that. How I can do client side filtering if? Data in this case is retrieved from webapi with single call.

0
Alexander Valchev
Telerik team
answered on 29 Jan 2016, 01:26 PM
Hi Jakub,

The behaviour occurs because filter widget (autocomplete) uses same dataSource settings as the Grid itself. That said when you see a call to the web server it is issued by the AutoComplete widget, not by the Grid.

In order to avoid this you can pass the data to the AutoComplete or turn off the serverFiltering of the AutoComplete widget. This example shows how to customize the filter widget settings.

I hope the information will help.

Regards,
Alexander Valchev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Jakub
Top achievements
Rank 1
answered on 01 Feb 2016, 11:32 AM

Can you send example in typescript using angularjs?

 My problem is that I have a directive that I put everywhere whenever Iam using kendoGrid. This directive sets default configuration for grid, as kendo doesnt have api like that.

Here is a snipped of my configuration. It works except for the template of cell. Iam assuming that template doesnt work as its sent as json. So basicly, how I can setup this cell templae using typescript, angularjs for all kendoGrids?

http://pastebin.com/RfexT7qX

 

 

0
Alexander Valchev
Telerik team
answered on 04 Feb 2016, 08:44 AM
Hello Jakub,

We do not have such example written in TypeScript. Since the filter cell template is a function you may stringify it as a JSON.

Regards,
Alexander Valchev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Jakub
Top achievements
Rank 1
answered on 04 Feb 2016, 08:52 AM
I stringified it and it didnt work. Can you atleast send me exmaple in javascript with the requirements I posted before?
0
Alexander Valchev
Telerik team
answered on 08 Feb 2016, 09:54 AM
Hello Jakub,

I made a typo in my previous answer. I meant to write "Since the filter cell template is a function you should NOT stringify it as a JSON."

Here is a runnable filter cell template example: http://dojo.telerik.com/IzoTU

Regards,
Alexander Valchev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Jakub
Top achievements
Rank 1
answered on 08 Feb 2016, 10:17 AM

Hello,

 I asked for angluarjs example with condition that the configuration of grid has to be inside directive. Similar to what I posted on pastebin:

http://pastebin.com/RfexT7qX

 

0
Alexander Valchev
Telerik team
answered on 10 Feb 2016, 04:18 PM
Hi Jakub,

We do not have example which meets your exact requirements. In scenarios where the Kendo Widget is required to be initialized in a directive we recommend to use jQuery initialization in the directives link function.

Regards,
Alexander Valchev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
Jakub
Top achievements
Rank 1
Answers by
Alexander Valchev
Telerik team
Jakub
Top achievements
Rank 1
Share this question
or