dynamically add rows to the grid as data comes in?

7 posts, 0 answers
  1. Ambrose
    Ambrose avatar
    4 posts
    Member since:
    Feb 2015

    Posted 08 Dec 2016 Link to this post

    I'm populated the grid with a long running process.

    I have this loop, it takes about 10 seconds to get 5 results, but let's say there are 20 results.

    How do I add the 5 results to the grid and keep appending to it as the results come in?

    I'm using asp.net mvc to get the data.

    I saw someone ask this a while back, but was just wondering if this feature has been added or anything.

     

    Thanks!

  2. carl
    carl avatar
    2 posts
    Member since:
    Dec 2016

    Posted 08 Dec 2016 Link to this post

    This sound like you have your paging limit send to 5 items, which you can increase. But you also have to have [DataSourceRequest] DataSourceRequest that retrieve the name 5 item on the read method.
  3. Ambrose
    Ambrose avatar
    4 posts
    Member since:
    Feb 2015

    Posted 09 Dec 2016 Link to this post

    This is not a question about paging - assume my paging limit is set to 100.

    Say you are doing something custom on the backend (like querying multiple tables) where you only getting 5 results every 10 seconds.

    How do you append to the grid as you get the results?  (as opposed to having the user wait for all the results to come in at once)

  4. Stefan
    Admin
    Stefan avatar
    2205 posts

    Posted 12 Dec 2016 Link to this post

    Hello Ambrose, Carl,

    If I understand correctly, if there are 5 results on the page and after 5 seconds new 5 come, the Grid has to show all 10 items?

    If this is correct, it can be achieved using the add method of the Kendo UI DataSource. Once the new data is available, use the add method to append the new items in the DataSource:

    http://docs.telerik.com/kendo-ui/api/javascript/data/datasource#methods-add

    Also, if the Grid is not re-rendered with the new data, use the refresh method to re-render the Grid:

    http://docs.telerik.com/kendo-ui/api/javascript/ui/grid#methods-refresh

    I hope this will help to achieve the desired result.

    Regards,
    Stefan
    Telerik by Progress
    Kendo UI is ready for Visual Studio 2017 RC! Learn more.
  5. Ambrose
    Ambrose avatar
    4 posts
    Member since:
    Feb 2015

    Posted 12 Dec 2016 in reply to Stefan Link to this post

    Thanks Stefan,

    Correct, this is the scenario.

    Your answer helps me with the client side. 

    But on the server side, are there any tricks I can use to 'stream' the data back (I'm using ASP MVC)?  i.e. after each iteration of a loop, can I "return" the results to the UI?  I don't think I can, but just thought I'd ask.

    I guess I can rewrite my Controller method a bit to just do one iteration of the loop and have the javascript make the web request to the controller method

  6. Stefan
    Admin
    Stefan avatar
    2205 posts

    Posted 14 Dec 2016 Link to this post

    Hello Ambrose,

    Unfortunately, we do not have specific tips for implementing data streaming as the Kendo UI is responsible for the client-side result and the server-side implementation is based on the developers' preference.

    In this scenario I can recommend our Progress Professional Services team which will be happy to assist you and provide a solution best suited for your scenario:

    https://www.progress.com/services/outsourcing/feature-customization

    Let me know if you are interested, and I will arrange for someone from the team to contact you.

    Regards,
    Stefan
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  7. Ambrose
    Ambrose avatar
    4 posts
    Member since:
    Feb 2015

    Posted 14 Dec 2016 in reply to Stefan Link to this post

    Thanks Stefan,

    This was just a 'nice to have' feature for us, but if we change our minds, I'll reach out.

    I appreciate you answering my questions!

Back to Top