Dojo   发布时间:2022-04-21  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了用Dojo实行Confirm模式对话框大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

//用例

var dlg = this._ynDlg;@H_197_3@ if (!dlg) {@H_197_3@ dlg = this._ynDlg = new DialogYesno({@H_197_3@ whenYes: function () {alert("yes"); }@H_197_3@ });@H_197_3@ }@H_197_3@ dlg.show("确认删除子账户吗?");@H_197_3@ });@H_197_3@

//源代码

//DialogYesno.js

define([@H_197_3@ "dojo/_base/declare",@H_197_3@ "dijit/Dialog",@H_197_3@ "dijit/_WidgetsInTemplatemixin",@H_197_3@ "dojo/text!./templates/DialogYesno.html",@H_197_3@ "dijit/form/Button"@H_197_3@ ],function (declare,Dialog,_WidgetsInTemplatemixin,templatE) {@H_197_3@ return declare([Dialog,_WidgetsInTemplatemixin],{@H_197_3@ baseClass: "DialogYN",@H_197_3@ templateString: template,@H_197_3@ title: "确认",@H_197_3@ whenNo: function () {@H_197_3@ },@H_197_3@ _no: function () {@H_197_3@ this.hide();@H_197_3@ this.whenNo();@H_197_3@ },@H_197_3@ whenYes: function () {@H_197_3@ },@H_197_3@ _yes: function () {@H_197_3@ this.hide();@H_197_3@ this.whenYes();@H_197_3@ },@H_197_3@ _keydown: function (event) {@H_197_3@ var key = event.keyCode;@H_197_3@ if (key === 78)@H_197_3@ this._no();@H_197_3@ else if (key === 89)@H_197_3@ this._yes();@H_197_3@ },@H_197_3@ show: function (content) {@H_197_3@ this.set("content",content);@H_197_3@ this.inherited(arguments);@H_197_3@ }@H_197_3@ });@H_197_3@ });@H_197_3@

//./templates/DialogYesno.html

<div class="dijitDialog" role="dialog" aria-labelledby="${iD}_title"> <div data-dojo-attach-point="titleBar" class="dijitDialogtitleBar"> <span data-dojo-attach-point="titleNode" class="dijitDialogtitle" id="${iD}_title" role="heading" level="1"></span> <span data-dojo-attach-point="closeButtonNode" class="dijitDialogCloseIcon" data-dojo-attach-event="ondijitclick: onCancel,keydown:_keydown" title="${ButtonCancel}" role="button" tabIndex="-1"> <span data-dojo-attach-point="closeText" class="closeText" title="${ButtonCancel}">x</span> </span> </div> <div data-dojo-attach-point="containerNode" class="dijitDialogPaneContent"> </div> <div style="BACkground-color:#ffffff;min-width: 200px;height: 40px"> <div data-dojo-attach-point="buttonContainer" style="float: right;margin-right: 20px"> <button data-dojo-type="dijit/form/Button" data-dojo-attach-point="btnYes" data-dojo-attach-event="onClick:_yes">是(Y) </button> <button data-dojo-type="dijit/form/Button" data-dojo-attach-point="btnNo" data-dojo-attach-event="onClick:_no">否(N) </button> </div> </div> </div>

大佬总结

以上是大佬教程为你收集整理的用Dojo实行Confirm模式对话框全部内容,希望文章能够帮你解决用Dojo实行Confirm模式对话框所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。