columns.Bound(p => p.isCurrentlyLocked)
.ClientTemplate("# if (isCurrentlyLocked && roles != 'Admin') { #"
+ "<input type='button' onclick='user_unlock' value='Unlock' class='k-button' />"
+ "# } else if(!isCurrentlyLocked && roles != 'Admin') {#"
+ "<input type='button' onclick='user_lock' value='Lock' class='k-button' />"
+ "#}#");
columns.Template(p => p.roles).ClientTemplate("# if (roles != 'Admin') { #"
+ "<input type='button' onclick='user_delete' value='Delete' class='k-button' />"
+ "# }#");
我无法调用我的Javascript函数user_unlock
,user_lock
或user_delete
。服务器生成类似onclick=\u0027user_delete\u0027
的Html。有谁知道如何解决这个问题?
答案 0 :(得分:0)
你能尝试如下: -
columns.Template(p => p.roles).ClientTemplate("# if (roles != \"Admin\") { #"
+ "<input type=\"button\" onclick=\"user_delete()\" value=\"Delete\" class=\"k-button\" />"
+ "# }#");