How to prevent grid from fetching data after grid.setOptions

8 posts, 1 answers
  1. Kudryk
    Kudryk avatar
    17 posts
    Member since:
    Dec 2014

    Posted 16 Mar 2015 Link to this post

    Hello.
    Please advise if it is possible to prevent grid from fetching data again after setOptions method was called.
  2. Kudryk
    Kudryk avatar
    17 posts
    Member since:
    Dec 2014

    Posted 16 Mar 2015 Link to this post

    I will try to create grid using saved options.
  3. Dimo
    Admin
    Dimo avatar
    8472 posts

    Posted 18 Mar 2015 Link to this post

    Hello Kudryk,

    setOptions() causes the Grid to re-initialize. If the widget is configured with Ajax data-binding, it will surely request its data once again. If it is configured with local data, no request will be made, because the data items are part of the Grid configuration.

    Regards,
    Dimo
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  4. Kudryk
    Kudryk avatar
    17 posts
    Member since:
    Dec 2014

    Posted 29 May 2015 in reply to Dimo Link to this post

    Please answer why setOptions() causes the Grid to fetch data even if autoSync is set to false in the dataSource ?
  5. Kudryk
    Kudryk avatar
    17 posts
    Member since:
    Dec 2014

    Posted 29 May 2015 in reply to Dimo Link to this post

    Is it possible to modify grid data Source before save settings to not fetch data after restore ?
  6. Answer
    Dimo
    Admin
    Dimo avatar
    8472 posts

    Posted 02 Jun 2015 Link to this post

    Hello Kudryk,

    I have provided some guidelines in the support ticket that you have posted. Please avoid opening duplicate forum threads and support tickets on the same topic, thanks.

    In case you need further assistance, please continue the discussion in one of the threads only.

    Regards,
    Dimo
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  7. John
    John avatar
    17 posts
    Member since:
    Jul 2014

    Posted 28 Mar 2016 in reply to Dimo Link to this post

    Hi Dimo.  You mention that you posted information in a support ticket for this issue.  Can you also post them here?  I have the same issue.  Every time grid.setOptions is called I get duplicate calls to an Ajax REST service to retrieve the data.  This is problematic when you have hundreds of users, and I'd like to avoid the extra call.  I appreciate any help or guidance on this. Thanks.
  8. Dimo
    Admin
    Dimo avatar
    8472 posts

    Posted 28 Mar 2016 Link to this post

    Hi John,

    Based on the code snippet provided by Kudryk, I suggested him to set autoBind to false. This will prevent the Grid from requesting data initially, before its proper state has been applied.

    http://docs.telerik.com/kendo-ui/api/javascript/ui/grid#configuration-autoBind

    Regards,
    Dimo
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top