kendo-ui – 将值传递给kendoWindow模板
发布时间:2020-12-14 04:25:40 所属栏目:Windows 来源:网络整理
导读:鉴于以下模板和函数,我如何传递函数参数contentText以在占位符###中的模板#password-validation中显示? 模板 script id="password-validation" type="text/x-kendo-template" p style="font-size: 12px; padding: 10px" ### /p div style="text-align: righ
鉴于以下模板和函数,我如何传递函数参数contentText以在占位符###中的模板#password-validation中显示?
模板 <script id="password-validation" type="text/x-kendo-template"> <p style="font-size: 12px; padding: 10px"> ### </p> <div style="text-align: right"> <button class="password-ok k-button">OK</button> </div> </script> 功能 function PasswordValidation(contentText) { var kendoWindow = $("<div />").kendoWindow({ actions: ["Close"],title: "Password validation",resizable: false,modal: true }); kendoWindow.data("kendoWindow") .content($("#password-validation").html()) .center().open(); kendoWindow .find(".password-ok") .click(function () { kendoWindow.data("kendoWindow").close(); }) .end() } 解决方法
这是解决方案:
<script id="password-validation" type="text/x-kendo-template"> <p style="font-size: 12px; padding: 10px"> #=data# </p> <div style="text-align: right"> <button class="password-ok k-button">OK</button> </div> </script> 和功能: function PasswordValidation(contentText) { var kendoWindow = $("<div />").kendoWindow({ actions: ["Close"],modal: true }); var template = kendo.template($("#password-validation").html()); kendoWindow.data("kendoWindow") .content(template(contentText)) .center().open(); kendoWindow .find(".password-ok") .click(function () { kendoWindow.data("kendoWindow").close(); }) .end() } (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- windows-server-2008 – 通过HTTP的MSMQ – 为什么我们需要
- 如何将Windows 7中的“身份验证缓存”清除为受密码保护的sa
- microsoft-graph – 为什么不返回刷新令牌的到期?
- windows – 运行批处理文件时隐藏CMD
- ms-access – 如何防止“请告诉Microsoft有关此问题”的对话
- windows安装msys2 mingw64
- Windows – 在服务器2008 R2上关闭没有足够的时间来保存所有
- 批量转换Windows / DOS文件到Unix的最佳方法是什么?
- Windows – 管理冗余/冲突组策略
- wpf – Datagrid SelectedItem在window.IsEnabled = false时