//模版html代码
<script id="auth-template" type="text/x-kendo-template">
<input type='checkbox' data-code="#:Code#" id='addCk_#:Code#' name='addCk_#:Code#'
data-bind="events:{change:ckChangeFrom}"/>新增
<input type='checkbox' data-code="#:Code#" id='delCk_#:Code#' name='delCk_#:Code#'
data-bind="events:{change:ckChangeFrom}"/>删除
<input type='checkbox' data-code="#:Code#" id='updateCk_#:Code#' name='updateCk_#:Code#'
data-bind="events:{change:ckChangeFrom}"/>更新
<input type='checkbox' data-code='#:Code#' id='queryCk_#:Code#' name='queryCk_#:Code#'
data-bind='events:{change:ckChangeFrom}'/>查询
</script>
<!--可以用style='#if (add!=1){#display: none;#}#' 判断语句来显隐某些元素-->
<script id="remove-template" type="text/x-kendo-template">
<input type='checkbox' data-id="#:addId#" data-type="add" id='addReCk_#:resourceCode#'
name='addReCk_#:code#' style='#if (add!=1){#display: none;#}#'
data-bind="events:{change:ckReChangeFrom}"/><span style='#if (add!=1){#display: none;#}#'>新增 </span>
<input type='checkbox' data-id="#:deleteId#" data-type="del" id='delReCk_#:resourceCode#'
name='delReCk_#:code#' style='#if (del!=1){#;display: none;#}#'
data-bind="events:{change:ckReChangeFrom}"/><span style='#if (del!=1){#;display: none;#}#'>删除 </span>
<input type='checkbox' data-id="#:updateId#" data-type="update" id='updateReCk_#:resourceCode#'
name='updateReCk_#:code#' style='#if (update!=1){#;display: none;#}#'
data-bind="events:{change:ckReChangeFrom}"/><span style='#if (update!=1){#;display: none;#}#'>更新 </span>
<input type='checkbox' data-id="#:queryId#" data-type='query' id='queryReCk_#:resourceCode#'
name='queryReCk_#:code#' style='#if (query!=1){#;display: none;#}#'
data-bind='events:{change:ckReChangeFrom}'/><span style='#if (query!=1){#;display: none;#}#'>查询 </span>
</script>
//treelist的mvvm写法
<div id="fromDiv" style="height:400px"
data-role="ctreelist"
data-selectable="multiple"
data-row-checkbox="true"
data-columns="[{ expandable: true,'field': 'Name','title':'资源名称', attributes: { 'class': 'cell-left' }},
{ 'field': 'Code','title':'资源代码'},{ 'field': 'authority','title':'权限',template:$('#auth-template').html()}]"
data-bind="source:fromDataSource,events:{change:selectFromItem}"
data-connect-with="selected2"></div>