]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/web/js/dojo/openils/widget/EditDialog.js
allow config settings to be passed in via args object to constructor
[working/Evergreen.git] / Open-ILS / web / js / dojo / openils / widget / EditDialog.js
1 if(!dojo._hasResource['openils.widget.EditDialog']) {
2     dojo.provide('openils.widget.EditDialog');
3     dojo.require('openils.widget.EditPane');
4     dojo.require('dijit.Dialog');
5
6
7     /**
8      * Given a fieldmapper object, this builds a pop-up dialog used for editing the object
9      */
10
11     dojo.declare(
12         'openils.widget.EditDialog',
13         [dijit.Dialog],
14         {
15             editPane : null, // reference to our EditPane object
16
17             constructor : function(args) {
18                 this.editPane = new openils.widget.EditPane(args);
19                 var self = this;
20                 this.editPane.onCancel = function() { self.hide(); }
21                 this.editPane.onPostApply = function() { self.hide(); }
22             },
23
24             /**
25              * Builds a basic table of key / value pairs.  Keys are IDL display labels.
26              * Values are dijit's, when values set
27              */
28             startup : function() {
29                 this.inherited(arguments);
30                 this.editPane.startup();
31                 this.domNode.appendChild(this.editPane.domNode);
32             }
33         }
34     );
35 }
36