I tried creating noDataTemplate, when I use it as normal javascript(with out ajax callback) like below it's working as expected
<script id="noDataTemplate" type="text/x-kendo-tmpl">
# var value = instance.input.val(); #
# var id = instance.element[0].id; #
# if(value == 'validUser') {#
<div>
do you want to add the user - <span style="font-weight:bold">'#: value #' </span>?
</div>
<br />
<button class="k-button" onclick="addnew('#: id #', '#: value #')" ontouchend="addnew('#: id #', '#: value #')">add new item</button>
# } else { console.log('value: ' + data);#
<div>
user does not exists
</div>
# } #
</script>
But as I have to validate user I used the template as below, it's executing without error, but the Html is not rendering in the template. it's showing the notemplate area, but there is no text inside it. (not even showing no data found). looks it's the issue because of callback. Please let me know how to solve this issue.
<script id="noDataTemplate" type="text/x-kendo-tmpl">
# var value = instance.input.val(); #
# var id = instance.element[0].id; #
# $.post("@Url.Action("validateuser", "AdminWorkflow")", {alias: instance.input.val()}, function(data){#
# if(data) {
<div>
do you want to add the user - <span style="font-weight:bold">'#: value #' </span>?
</div>
<br />
<button class="k-button" onclick="addnew('#: id #', '#: value #')" ontouchend="addnew('#: id #', '#: value #')">add new item</button>
# } else { console.log('value: ' + data);#
<div>
user does not exists test
</div>
# } #
#}) #
</script>