Disable server filtering on keypress

10 posts, 0 answers
  1. Jakub
    Jakub avatar
    24 posts
    Member since:
    Jun 2015

    Posted 25 Jan 2016 Link to this post

    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?

  2. Alexander Valchev
    Admin
    Alexander Valchev avatar
    2895 posts

    Posted 27 Jan 2016 Link to this post

    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!
     
  3. Jakub
    Jakub avatar
    24 posts
    Member since:
    Jun 2015

    Posted 27 Jan 2016 Link to this post

    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.

  4. Alexander Valchev
    Admin
    Alexander Valchev avatar
    2895 posts

    Posted 29 Jan 2016 Link to this post

    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!
     
  5. Jakub
    Jakub avatar
    24 posts
    Member since:
    Jun 2015

    Posted 01 Feb 2016 Link to this post

    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

     

     

  6. Alexander Valchev
    Admin
    Alexander Valchev avatar
    2895 posts

    Posted 04 Feb 2016 Link to this post

    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!
     
  7. Jakub
    Jakub avatar
    24 posts
    Member since:
    Jun 2015

    Posted 04 Feb 2016 in reply to Alexander Valchev Link to this post

    I stringified it and it didnt work. Can you atleast send me exmaple in javascript with the requirements I posted before?
  8. Alexander Valchev
    Admin
    Alexander Valchev avatar
    2895 posts

    Posted 08 Feb 2016 Link to this post

    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!
     
  9. Jakub
    Jakub avatar
    24 posts
    Member since:
    Jun 2015

    Posted 08 Feb 2016 Link to this post

    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

     

  10. Alexander Valchev
    Admin
    Alexander Valchev avatar
    2895 posts

    Posted 10 Feb 2016 Link to this post

    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!
     
Back to Top