dojo小例子36ResizableDialog 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'" onclick="dijit.byId('selectDlg').show();">选择</button>

相关文章

我有一个网格,可以根据更大的树结构编辑小块数据.为了更容易...
我即将开始开发一款教育性的视频游戏.我已经决定以一种我可以...
我正在使用带有Grails2.3.9的Dojo1.9.DojoNumberTextBox小部...
1.引言鉴于个人需求的转变,本系列将记录自学arcgisapiforja...
我正在阅读使用dojo’sdeclare进行类创建的语法.描述令人困惑...
我的团队由更多的java人员和JavaScript经验丰富组成.我知道这...