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>
            <ul>
                <li>Bob Jones</li>
            </ul>
        </li>
         
        <li> Assets
            <ul data-role=listview">
                <li>Lawn Mower</li>
                <li>Leaf Blower</li>
                <li>Hedge Clippers</li>
            </ul>
        </li>
    </ul>

    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

    Hi
    Any way of doing this ?
  3. Kendo UI is VS 2017 Ready
  4. Alexander Valchev
    Admin
    Alexander Valchev avatar
    2877 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: http://jsbin.com/osehad/2/edit
    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!
  5. NirKo
    NirKo avatar
    4 posts
    Member since:
    Nov 2010

    Posted 23 Mar 2013 Link to this post

    Hi
    Thank you for the example, work greats.
    Nir
Back to Top
Kendo UI is VS 2017 Ready