I have this code:
var columns = [];
$.each(actions, function (idx, action) {
actionColumn = {
template: '#if (selfActions[i].name === "' + action.name + '"){ # <input type="checkbox" /> some text # } # '
}
columns.push(actionColumn);
});
$("#myId").kendoTreeList({
//...
columns: columns
});
And I want to convert to template such as:
<script id="rowLeaveTemplate" type="text/x-kendo-tmpl">
if (selfActions[i].name === '???action.name???' ){#
<input type="checkbox" /> some text
# } #
</script>
How can I pass parameter action.name
to template to replace '???action.name???'
Something like this:
actionColumn = {
template: function(dataItem) {
return kendo.template($("#rowLeaveTemplate").html())({ actionName:action.name });
}
}
and kendo template itself:
<script id="rowLeaveTemplate" type="text/x-kendo-template">
# if (selfActions[i].name === actionName ){#
<input type="checkbox" /> some text
# } #
</script>