Read method is called twice - not always

5 posts, 0 answers
  1. Shahar
    Shahar avatar
    8 posts
    Member since:
    Oct 2018

    Posted 23 Oct 2018 Link to this post

    Hi

     

    I have severals tabs on the tab strip, each ith its own grid.
    When I build the grids from JS code I specify autobind = false.

    On with my code, I'm doing a call to filter method on a grid to apply some filter when it loads
    and a few lines afterward it calls to dataSource.read method.

    When I check the network tab on the dev tools I see The current tab grid is calling twice to get the data,
    and the other tabs grid call only once to fetch the data.

     

    Why is this behavior?

    Attached screenshots of the network tab showing what I mean.

    If you need any more data let me know

     

    Thanks

  2. Tsvetina
    Admin
    Tsvetina avatar
    2481 posts

    Posted 25 Oct 2018 Link to this post

    Hi Shahar,

    On an empty DataSource, the filter() method internally triggers a server read request, even if you do not have server filtering enabled. This being said, if you are calling grid.dataSource.filter(someExpression), you do not need to also call grid.dataSource.read() afterwards.
    Do you observe any problems if you remove the grid.dataSource.read() call?

    Regards,
    Tsvetina
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  3. Shahar
    Shahar avatar
    8 posts
    Member since:
    Oct 2018

    Posted 25 Oct 2018 in reply to Tsvetina Link to this post

    Yes, I do experience some issues when I take out the call to read method.

    I will check it on Sunday as I think I have an idea why.

    I will get back to you on this

     

    Thanks

  4. Tsvetina
    Admin
    Tsvetina avatar
    2481 posts

    Posted 29 Oct 2018 Link to this post

    Hi Shahar,

    Did you locate the cause of the problem when removing the read() call? If not, you can share the actual code that you run, along with an explanation when/where this code is executed and a copy of the Grid declaration, just in case.

    Regards,
    Tsvetina
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  5. Shahar
    Shahar avatar
    8 posts
    Member since:
    Oct 2018

    Posted 29 Oct 2018 in reply to Tsvetina Link to this post

    Hi

     

    This morning I implemented a fix which removed the double call.

    I will have to wait for a few days to see if there are any side effects.

     

    Thank you for your help

Back to Top