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

Listview with ActionLink Statement

2 Answers 133 Views
ListView (Mobile)
This is a migrated thread and some comments may be shown as answers.
Peter
Top achievements
Rank 1
Peter asked on 04 Mar 2012, 06:37 PM
Hi
I'm using Kendo Mobile UI combined with MVC elements.
All is working well, but In the Kendo Mobile UI Listview Element like (on a  page Kendo.cshtml):

<ul data-role="listview" data-style="inset" data-type="group">
<li>
<ul>
<li data-icon="globe"><a>@Html.ActionLink("Test Button (works)", "Button", "Home")</a></li>
<li data-icon="globe">@Html.ActionLink("Test Button (not working)", "Button", "Home")</li>
</ul>
</li>
</ul>


On my iPhone I get:
A) a Listview element which is underlined with no data icon and no arrow ">" (incorrect style)
B) a Listview element with data icon and arrow ">" (correct style)

Both Links are loading the same Button.cshtml file.
The Page is simple and shows the event handling of buttons like the button event example of kendo mobile UI
But only A) one loads the page correctly so that the event are properly handled.
B) loads the page but the events are not fired.

So, at the moment I have to select A) for correct behaviour but "bad" style

What is the correct statement for an action link in a listview showing the dataicon and the arrow
AND the correct behaviour?

Regards, Peter

2 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 05 Mar 2012, 09:13 AM
Hello,

 This statement creates nested <a> elements which is not supported by any browser:

<a>@Html.ActionLink("Test Button (works)", "Button","Home")</a> 

Html.ActionLink renders an <a> element on its own.

Kind regards,
Atanas Korchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Petyo
Telerik team
answered on 05 Mar 2012, 09:26 AM
Hello,

As Atanas already mentioned, the second approach is the correct one. However, I am not sure to which events you refer with the following sentence:

B) loads the page but the events are not fired.

Can you please clarify a bit? 

I also prepared one simple jsFiddle to demonstrate the case. Feel free to modify it in order to demonstrate the problem. 

Regards,
Petyo
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
ListView (Mobile)
Asked by
Peter
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Petyo
Telerik team
Share this question
or