Best design for listview with chart generation?

2 posts, 0 answers
  1. Per
    Per avatar
    120 posts
    Member since:
    Jan 2008

    Posted 23 Aug 2013 Link to this post


    I have a application with 2 views.
    The first view contains a list of charts I can choose from.
    When a user clicks on one of the rows in the list, the second view slides in and presents the chart.
    All data is retreived from ONE json url. The data I get back from the json service contains all charts.

    I been trying to figure out what's the best design for handling data retrival and ui interactions.
    Shall I retrive all data when my application starts, and store it as a array?
    Shall I retrived the chartsdata from the datasource, in the "OnClick" event, when the user clicks on a row?
    Shall I create the chart in the OnClick event?

    What is the best practice in this senario?

    I'm greatfull for any answers :)

  2. T. Tsonev
    T. Tsonev avatar
    2815 posts

    Posted 26 Aug 2013 Link to this post


    Since you already have the data it would make most sense to create the charts in your "click" handler.
    Check the "Binding to local data" examples for a syntax reference.

    If you don't want to load all the data in advance then use a data source on each chart, as in the "Binding to remote data" demos. 
    This will save you the trouble of sifting through the initial data, but will require dedicated service for each chart.

    I hope this helps.

    T. Tsonev
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top