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

kendo mobile grid - column template

1 Answer 50 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Shaun
Top achievements
Rank 1
Shaun asked on 07 May 2014, 04:30 PM
Hello,

here's what I am trying to achieve:

I have a mobile web app using a  kendo grid on a page.
One of the columns has a template something like : "<a href='##' onclick='someViewmodel.rowClicked(#:someValue#);'''

When the hyperlink is clicked the app is supposed to navigate to a specific mobile view. Instead of doing this it navigates to the home page.
Normally when I trigger anything from a mobile grid I have to do an e.preventDefault() in order to stop unwanted behaviour and then everything works as expected.

In this case however I cannot do that as I do not have the event. If I try to use an mvvm binding inside the template, it does not work as it looks the mvvm bindings happen before the template is rendered. So if I try to do an data-bind="click: run" then it is completely ignored.

how can I stop the default grid behaviour so that the app navigates to the right place ? 

Fiddle Example

1 Answer, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 08 May 2014, 07:38 AM
Hello Stuart,

As you may know, click event can be prevented by returning false:

<a href='\#' onclick='someViewmodel.rowClicked(#:someValue#); return false;'>

Here you can find a small sample of this in action.

Regards,
Rosen
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
General Discussions
Asked by
Shaun
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Share this question
or