ListView in ListView

4 posts, 0 answers
  1. Ron
    Ron avatar
    2 posts
    Member since:
    Aug 2012

    Posted 17 Sep 2012 Link to this post

    Hello all,

    To jump right in, is there a way to have a listview within a listview?

    The use of this is something like this:

    <ul data-role="listview" data-style="inset" data-type="group">
                <li>Bob Jones</li>
        <li> Assets
            <ul data-role=listview">
                <li>Lawn Mower</li>
                <li>Leaf Blower</li>
                <li>Hedge Clippers</li>

    The Asset listview is populated dynamically (and could have any number of asset items), while the outter listview is static. This is just an example. In my case, I have multiple lists like the asset list that are also populated dynamically.

    I have a hackish way to get it to work using one big template for the main listview, and inside it, I populate the inner lists something like this:

    # for (var i = 0; i < assetList.length; i++) { #
    <li>#= assetList[i] #</li>
    # } #

    It works, but as mentioned, it is hackish, and I figure Kendo has a way to do it. A google search for "listview in listview" yields next to nothing suprisingly.

    I know there's the ObservableObject, ObservableArray, HeirarchalDataSource, and DataSource. To be honest, I've read the documentation for them, but there aren't any complex, or "real world" examples that shown advanced use of the components, so it kind of leaves you to have to try a lot of experimentation (and a LOT of guessing) in order to use it to it's full potential.
  2. NirKo
    NirKo avatar
    4 posts
    Member since:
    Nov 2010

    Posted 18 Mar 2013 Link to this post

    Any way of doing this ?
  3. Alexander Valchev
    Alexander Valchev avatar
    2895 posts

    Posted 21 Mar 2013 Link to this post

    Hello Nir,

    I tested this scenario with latest KendoUI release and got everything to work as expected. Here is an example:
    Please test the solution and let me know if you experience any problems. Thank you in advance.

    Kind regards,
    Alexander Valchev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  4. NirKo
    NirKo avatar
    4 posts
    Member since:
    Nov 2010

    Posted 23 Mar 2013 Link to this post

    Thank you for the example, work greats.
Back to Top