dojo小例子(36)ResizableDialog widget可缩放对话框

给dialog增加缩放功能
define([
	"dojo/_base/declare",
	"dijit/_WidgetBase",
	"dijit/_TemplatedMixin",
	"dijit/_WidgetsInTemplateMixin",
	"dojox/layout/ResizeHandle",
	"dojox/widget/DialogSimple"
],function(declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, ResizeHandle, DialogSimple){

	return declare([DialogSimple], {
		templateString: '<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" 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>	<span dojoAttachPoint="resizeHandle" class="dojoxFloatingResizeHandle"></span></div>',
		
		resizable: false,
		
		resizeAxis: "xy",
		
		postCreate: function(){
			this.inherited(arguments);
			if(!this.resizable){
				this.resizeHandle.style.display = "none"; 	
			}
		},
		
		startup: function(){
			this.inherited(arguments);
			if (this.resizable) {
				this.containerNode.style.overflow = "auto";
				this._resizeHandle = new ResizeHandle({
					targetId: this.id,
					resizeAxis: this.resizeAxis
				},this.resizeHandle);
			}
		},
		
		hide: function() {
			this.onHide();
			this.inherited(arguments);
		},
			
		onHide: function () {
			
		}
		
	});
});
<div data-dojo-type="my/ResizableDialog" id="selectDlg" data-dojo-props="title:'选择', resizable:true, href:'mot/selectDlg.html'"></div>
<button type="button" data-dojo-type="dijit/form/Button" data-dojo-props="iconClass:'dijitIconSearch'" οnclick="dijit.byId('selectDlg').show();">选择</button>


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值