and this is onlne code: http://jsfiddle.net/shahr0oz/K4X3T/19/
I have a dropdownlist in my view i want in my view.I want when change my dropdownlist,a java script template bind dropdownlist.i write this but dont work plead help me.
var roles=[{
code:1,
roleName: "Admin",
access: [
{ id: 1, description: "create", selected: true},
{id: 2, description: "delete", selected: false},
{ id: 3, description: "update", selected: false}
]
} ,{
code:2,
roleName: "user",
access: [
{ id: 1, description: "create", selected: true},
{id: 2, description: "delete", selected: true},
{ id: 3, description: "update", selected: false}
]
}];
var viewModel = kendo.observable({
Roles:roles,
role:"Admin",
accessRole:null
});
kendo.bind($("#example"), viewModel);
<
div
id
=
"example"
>
Current Role :<
span
data-bind
=
"text: role"
></
span
>
<
br
>
<
select
type
=
"text"
id
=
"RoleName"
data-bind
=
"source: Roles, value:role"
data-text-field
=
"roleName"
>
<
select
/>
<
ul
data-template
=
"row-template"
data-bind
=
"source: accessRole.access"
></
ul
>
</
div
>
<
script
id
=
"row-template"
type
=
"text/x-kendo-template"
>
<
li
>
<
input
type
=
"checkbox"
data-bind
=
"checked: selected"
/>
<
label
data-bind
=
"text: description"
/>
</
li
>
</
script
>
K4X3T