From: Alan Knowles Date: Fri, 30 Nov 2018 03:38:40 +0000 (+0800) Subject: examples/bootstrap/modal.js X-Git-Url: http://git.roojs.org/?p=roojs1;a=commitdiff_plain;h=843a7f33653bc4e800d11c481a12c33016430256 examples/bootstrap/modal.js --- diff --git a/examples/bootstrap/modal.js b/examples/bootstrap/modal.js index 3d0623bd07..f4142fb2c9 100644 --- a/examples/bootstrap/modal.js +++ b/examples/bootstrap/modal.js @@ -7,24 +7,33 @@ Roo.example = Roo.example || {}; -Roo.example.modal = new Roo.XComponent({ - part : ["layout","modal"], - order : '001-modal', - region : '', - parent : '#bootstrap', - name : "unnamed module", - disabled : false, - permname : '', - _tree : function() - { - - this.parent.el.layout = false; - this.parent.el.render(document.body); - +Roo.example.modal= function() {} +Roo.apply(Roo.example.modal, { + dialog : false, + callback: false, + + show : function(data, cb) + { + if (!this.dialog) { + this.create(); + } + + this.callback = cb; + this.data = data; + this.dialog.show(this.data._el); + if (this.form) { + this.form.reset(); + this.form.setValues(data); + this.form.fireEvent('actioncomplete', this.form, { type: 'setdata', data: data }); + } + + }, + + create : function() + { + var _this = this; - var MODULE = this; - var baseURL = '/web.eventmanager/demo.local.php'; - + return { xtype: 'Modal', xns: Roo.bootstrap,