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

Nested Listview from the model

1 Answer 421 Views
ListView
This is a migrated thread and some comments may be shown as answers.
Chandu
Top achievements
Rank 1
Chandu asked on 31 Mar 2012, 04:28 PM
Is there anyway we can populate the listview from the datamodel where the Data object will have nested objects example:

http://jsfiddle.net/RVCX5/ 

When the Lisview is first loaded show the Automobiles: Cars, Bikes.

When the user selects Cars: Show the items related to the Cars. Change the back button text to Cars, handle proper back and forth navigation. 

Can this be achieved with the current features of Listview?

Thanks,
Chandu

1 Answer, 1 is accepted

Sort by
0
Nikolay Rusev
Telerik team
answered on 04 Apr 2012, 09:46 AM
Hello Chandu,

Generally speaking I don't think that ListView is appropriate widget for this scenario. You can quite easily implement it by utilizing the Kendo templates.

To bind the ListView widget the data source should be list of object(i.e [{ field: "value"}....]). Which for the case of Cars/Bikes is not the case.

For you convenience I've build an example demonstrating how you can achieve similar effect by using ListView widget, by changing the data for the DataSource.
http://jsfiddle.net/qJXAD/

Please notice that in the implementation above I assume that the data structure for the DataSouce is homogeneous, i.e items for both types and manufactures are of type { name: "value"}.

Greetings,
Nikolay Rusev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Bhumi
Top achievements
Rank 1
commented on 03 Aug 2023, 08:41 PM

Hi Nikolay,

I am also looking for same kind of solution, but https://jsfiddle.net/qJXAD/ is not running successfully.

It will be great if you can provide me running fiddle?

Thank You,

BDP

 

 

 

Georgi Denchev
Telerik team
commented on 08 Aug 2023, 10:40 AM

Hello, BDP,

Here's the snippet from the Fiddle that my colleague previously shared:

https://dojo.telerik.com/@gdenchev/uFOBeGOX 

Best Regards,

Georgi

Tags
ListView
Asked by
Chandu
Top achievements
Rank 1
Answers by
Nikolay Rusev
Telerik team
Share this question
or