This is a migrated thread and some comments may be shown as answers.

ListView in ListView

3 Answers 232 Views
ListView
This is a migrated thread and some comments may be shown as answers.
Ron
Top achievements
Rank 1
Ron asked on 17 Sep 2012, 09:32 PM
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.

3 Answers, 1 is accepted

Sort by
0
NirKo
Top achievements
Rank 1
answered on 18 Mar 2013, 10:18 AM
Hi
Any way of doing this ?
0
Alexander Valchev
Telerik team
answered on 21 Mar 2013, 09:05 AM
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!
0
NirKo
Top achievements
Rank 1
answered on 23 Mar 2013, 04:30 PM
Hi
Thank you for the example, work greats.
Nir
Tags
ListView
Asked by
Ron
Top achievements
Rank 1
Answers by
NirKo
Top achievements
Rank 1
Alexander Valchev
Telerik team
Share this question
or