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

Pass additional parameters to Data method of Mobile Listview

1 Answer 300 Views
ListView (Mobile)
This is a migrated thread and some comments may be shown as answers.
LearnMVC
Top achievements
Rank 1
LearnMVC asked on 26 May 2015, 03:42 AM
In Listview,I used Data method to passing additional parameters : 

.Read(read => read.Action("Products_Read", "ListView").Data("additionalInfo"))

But Mobile Listview not exist  Data menthod like Listview.
Please can you show my how to pass addtional parameter in Mobile Listview(MVC) for Read operation and how to handle it in corresponding Controller?

1 Answer, 1 is accepted

Sort by
0
Boyan Dimitrov
Telerik team
answered on 27 May 2015, 04:20 PM

Hello,

The CRUD operations are part of the Kendo data source configuration, not the widget itself. The Mobile Listview, ListView and other widgets use the Kendo data source, so the Data method should exist in this case as well. 

I tested the following scenario and the Data method works as expected: 

@(Html.Kendo().MobileView()
        .Name("grouped")      
        .Title("ListView")
        .Layout("databinding")
        .Content(obj =>       
            Html.Kendo().MobileListView()
                .Name("grouped-listview")
                .TemplateId("template")               
                .FixedHeaders(true)
                .DataSource(dataSource =>
                    dataSource
                        .Read(read => read.Action("GroupedData", "Mobile_ListView").Data("additionalInfo"))
                        .Group(group => group.Add("Letter", typeof(string)))
                )
        )       
)

public ActionResult GroupedData([DataSourceRequest] DataSourceRequest request, int UserID)
       {
        ...
       }

<script>
    function additionalInfo() {
        return {
            userID: 42
        };
    }
</script>

Regards,
Boyan Dimitrov
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
ListView (Mobile)
Asked by
LearnMVC
Top achievements
Rank 1
Answers by
Boyan Dimitrov
Telerik team
Share this question
or