Hi all,
I just new in kendo ui and you may consider my question silly, but still I need to get an answer.
All code is available here: http://jsfiddle.net/Oleksii/vvCHX/27/
In my scenario I have mobile application with 2 views:
I just new in kendo ui and you may consider my question silly, but still I need to get an answer.
All code is available here: http://jsfiddle.net/Oleksii/vvCHX/27/
In my scenario I have mobile application with 2 views:
- defaultView (id="") contains 2 list view: one statically defined; the second one is initialized in view init event handler); This non-static listview has template called "fileGroupsItemTemplate".
- second view has no content (id="aboutView").
- be clickable (I mean Link Items) to get ability to navigate to other view;
- have switch on the right side in every row
- View MUST be chnaged only if switch is checked
I faced with the problems: if I click on switch it changes its value, but current view is changed too.
It is because switch is inside <a> tag (see template). But if I put it out of <a> tag, 1) items are shown as a link; 2) items become unclickable; 3) if I click the link, then will get an error:
It is because switch is inside <a> tag (see template). But if I put it out of <a> tag, 1) items are shown as a link; 2) items become unclickable; 3) if I click the link, then will get an error:
{
"error"
:
"Please use POST request"
}
Doew anyone know how to prevent changing view after clicking on switch inside <a> tag? I was thinking about some trick in event handlers, but item-click event of list view is raised in the first place, and switch-change just after.
Here is template:
Here is template:
<
script
id
=
"fileGroupsItemTemplate"
type
=
"text/x-kendo-template"
>
<
table
>
<
tr
><
td
>
<
img
src
=
"#= data.Image#"
/>
</
td
><
td
style
=
"vertical-align: middle"
>
#= data.Name #
</
td
>
</
tr
>
</
table
>
#if(data.Docs.length > 0){#
<
ul
>
#for(var i=0; i <
data.Docs.length
; i++){#
<li>
<
a
>#=data.Docs[i].Name#
<
input
data-on-label
=
"Cl"
data-off-label
=
"Sk"
data-role
=
"switch"
#=data.Docs[i].NeedProcess ? "
checked
=
'checked'
" : ""# />
</
a
>
</
li
>
#}#
</
ul
>
#}#
</
script
>