]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/web/js/dojo/openils/widget/EditDialog.js
rearranging some classes around for better re-use. added an initial auto-grid, need...
[working/Evergreen.git] / Open-ILS / web / js / dojo / openils / widget / EditDialog.js
1 /**
2 var dialog = new openils.widget.EditDialog({
3     fmObject: survey,
4     fieldOrder: ['id', 'name', 'description', 'start_date', 'end_date']
5 });
6 dialog.startup();
7 dialog.show();
8 */
9
10
11
12 if(!dojo._hasResource['openils.widget.EditDialog']) {
13     dojo.provide('openils.widget.EditDialog');
14     dojo.require('openils.widget.EditPane');
15     dojo.require('dijit.Dialog');
16
17     /**
18      * Given a fieldmapper object, this builds a pop-up dialog used for editing the object
19      */
20
21     dojo.declare(
22         'openils.widget.EditDialog',
23         [dijit.Dialog],
24         {
25             editPane : null, // reference to our EditPane object
26
27             constructor : function(args) {
28                 this.editPane = new openils.widget.EditPane(args);
29                 var self = this;
30                 this.editPane.onCancel = function() { self.hide(); }
31                 this.editPane.onPostApply = function() { self.hide(); }
32             },
33
34             /**
35              * Builds a basic table of key / value pairs.  Keys are IDL display labels.
36              * Values are dijit's, when values set
37              */
38             startup : function() {
39                 this.inherited(arguments);
40                 this.editPane.startup();
41                 this.domNode.appendChild(this.editPane.domNode);
42             }
43         }
44     );
45 }
46