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

Selection from a listview.

5 Answers 177 Views
ListView
This is a migrated thread and some comments may be shown as answers.
RodEsp
Top achievements
Rank 2
RodEsp asked on 06 Jun 2012, 06:46 PM
Hello,

So I have a json file that looks something like this:
[{
    "Id": "1",
    "People": [{
        "Person": {
            "Name": "Jon"
        },
        "Job": "IT Guy"
    }]
},
{
    "Id": "2",
    "People": [{
        "Person": {
            "Name": "Kate"
        },
        "Job": "Web Developer"
    }]
}]

And data source created form this file
var dataSource = new kendo.data.DataSource({
    transport: {
        read: {
            url: url,
            type: "GET",
            dataType: "jsonp",
            contentType: "application/json; charset=utf-8"
        }
    }
});

 I'm displaying the Id of the arrays on listview A in my application. What I want to do is display a person's name in listview B depending on what Id was selected on listview A.

I've tried several different approaches including trying to create a datasource from the nested "people" array in the json file but have not been successful so far. Can anyone suggest a good method for accomplishing this?

**Edit: I apologize for posting this under the Datasource section instead of the Listview one. If a admin would like to move this post I'd be grateful.

5 Answers, 1 is accepted

Sort by
0
Accepted
Alexander Valchev
Telerik team
answered on 07 Jun 2012, 02:12 PM
Hi Rodrigo,

I am afraid that this scenario is not supported out of the box, because the dataSource is not designed to operate with nested data structures at the one you provided.
As a workaround I suggest to hook up to the change event of the listView and render a template with the current data. For convenience I prepared a small example that shows this approach in action.





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
RodEsp
Top achievements
Rank 2
answered on 07 Jun 2012, 02:21 PM
Thanks, I'm taking a look at it now.

Also, perfect timing. I opened up WebStorm and a second later got the response notification haha.

Edit:
Thank you, that worked very well.
0
RodEsp
Top achievements
Rank 2
answered on 07 Jun 2012, 07:47 PM
Hey, quick follow up question.

I've been trying to get this to work on the Kendo mobile framework but I've been having trouble since listviews and other widgets don't work the same way. Are there plans to integrate the Kendo web widgets into the Kendo mobile framework?

Edit:
I got it working the way I want, but with some unexplainable HTML behavior...
0
Alexander Valchev
Telerik team
answered on 12 Jun 2012, 08:10 AM
Hello Rodrigo,

Generally speaking you should be able to use most of the web controls in mobile applications. In case you need any further assistance, I would like to recommend to open a support ticket, preferably with a runnable project attached. Thus way you can be sure that your question will reach the corresponding staff member in time and will be reviewed and answered faster.
Thank you in advance for your understanding.

Greetings,
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
RodEsp
Top achievements
Rank 2
answered on 12 Jun 2012, 02:30 PM
Well I was mostly talking about the events that pertain to each widget. The mobile versions seem to have different and/or not as many events. Thanks for the response though, much appreciated :)
Tags
ListView
Asked by
RodEsp
Top achievements
Rank 2
Answers by
Alexander Valchev
Telerik team
RodEsp
Top achievements
Rank 2
Share this question
or