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

Remote view Razor syntax example

5 Answers 73 Views
ListView (Mobile)
This is a migrated thread and some comments may be shown as answers.
Brian
Top achievements
Rank 1
Brian asked on 11 Aug 2013, 03:46 AM
Are there any remote view examples in razor syntax anywhere?  I have not been able to find any and need to get them working.

5 Answers, 1 is accepted

Sort by
0
Brian
Top achievements
Rank 1
answered on 11 Aug 2013, 04:47 PM
I think I got remote views working fine, just not inside of a drawer.  Is there anything special that needs to be configured on the drawer to have remote views?

@(Html.Kendo().MobileDrawer()
        .Name("my-drawer")
        .HtmlAttributes(new { style = "width: 280px" })
.Views("drawer-welcome", "/Home/sites", "drawer-volumes", "drawer-production")
.Content(obj =>
            Html.Kendo().MobileListView().Type("group")
                .Items(root =>
                {
                    root.Add().Text("Main Menu").Items(items =>
                    {
                        items.AddLink().Icon("inbox").Url("sites", "Home").Text("Site Data");
                        items.AddLink().Icon("star").Url("volumes", "Home").Text("Volumes");
                        items.AddLink().Icon("compose").Url("production", "Home").Text("Production");
                        items.AddLink().Icon("sent").Url("inventory", "Home").Text("Inventory");
                        items.AddLink().Icon("trash").Url("reports", "Home").Text("Reports");

                    });
0
Petyo
Telerik team
answered on 12 Aug 2013, 09:09 AM
Hello Brian,

the drawer should work out of the box with remote views. After the remote view has been loaded, you can use the web inspector to verify that its id matches the one specified in the drawer. Of course, if the drawer should be displayed in all views, you can remove the view setting altogether.

// use something like this in the inspector to display the remote view id
 
$("#my-home-sites-remote-view-id").data("id");

Regards,
Petyo
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Brian
Top achievements
Rank 1
answered on 13 Aug 2013, 01:05 PM
Is this correct syntax for a remote view?

items.AddLink().Icon("star").Url("Contact", "Home", "#drawer-starred").Text("Starred Items");
0
Nikolay Rusev
Telerik team
answered on 14 Aug 2013, 10:52 AM
Hello Brian,

Isn't this the same as discussed in ticket with ID: 725528? If so, I'll consider it as resolved, right?

Regards,
Nikolay Rusev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Brian
Top achievements
Rank 1
answered on 14 Aug 2013, 12:38 PM
yes, consider it closed.  For anyone else having problems make sure the remote view does not include any application initialization tags or your app will not start properly.
Tags
ListView (Mobile)
Asked by
Brian
Top achievements
Rank 1
Answers by
Brian
Top achievements
Rank 1
Petyo
Telerik team
Nikolay Rusev
Telerik team
Share this question
or