感谢理查德的问题和建议。这对我有用,如果其他人需要类似的东西,我会在此处添加它:
define([
'dojo/_base/declare',
'dijit/_TemplatedMixin',
'dijit/_WidgetsInTemplateMixin',
'dojo/text!./DialogResize.html',
'dojox/layout/ResizeHandle',
'dijit/Dialog'], function (
declare,
_TemplatedMixin,
_WidgetsInTemplateMixin,
template,
ResizeHandle,
Dialog
) {
return declare('app.Dialog.Resize', [Dialog, _TemplatedMixin, _WidgetsInTemplateMixin], {
templateString: template,
// resizeAxis: String
// One of: x | xy | y to limit pane's sizing direction
resizeAxis: "xy",
postMixInProperties: function() {
this.inherited(arguments);
//console.log('DialogResize');
},
startup: function() {
//console.log('DialogResize startup');
// The orginal template was modifed by adding a resizeHandle handle, which is then initialised here
this._resizeHandle = new ResizeHandle({
targetId: this.id,
resizeAxis: this.resizeAxis
}, this.resizeHandle);
}
});
});
然后DialogResize.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" 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>
${!actionBarTemplate}
<span dojoAttachPoint="resizeHandle" class="dojoxFloatingResizeHandle"></span>
</div>