]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/web/templates/default/conify/global/config/coded_value_map.tt2
Merge remote branch 'working/user/dbs/lp801624_blow_away_postgresql'
[working/Evergreen.git] / Open-ILS / web / templates / default / conify / global / config / coded_value_map.tt2
1 [% WRAPPER default/base.tt2 %]
2 <h1>Code Value Maps</h1> <br/>
3
4 <div dojoType="dijit.layout.ContentPane" layoutAlign="client" class='oils-header-panel'>
5     <div>Coded Value Maps</div>
6     <div>
7         <button dojoType='dijit.form.Button' onClick='ccvmGrid.showCreateDialog()'>New Map</button>
8         <button dojoType='dijit.form.Button' onClick='ccvmGrid.deleteSelected()'>Delete Selected</button>
9     </div>
10 </div>
11
12 <div dojoType="dijit.layout.ContentPane" layoutAlign="client">
13     <span>Record Attribute Type: </span><div id='attr-def-div'/>
14 </div>
15
16 <div dojoType="dijit.layout.ContentPane" layoutAlign="client">
17     <table  jsId="ccvmGrid"
18             autoHeight='true'
19             dojoType="openils.widget.AutoGrid"
20             fieldOrder="['ctype', 'code', 'value', 'description']"
21             query="{code: '*'}"
22             defaultCellWidth='"25%"'
23             fmClass='ccvm'
24             showPaginator='true'
25             editOnEnter='true'/>
26  </div>
27
28 <script type ="text/javascript">
29
30     dojo.require('dijit.form.FilteringSelect');
31     dojo.require('openils.widget.AutoGrid');
32     dojo.require('openils.widget.AutoFieldWidget');
33
34     openils.Util.addOnLoad(
35         function() {
36
37             var selector = new openils.widget.AutoFieldWidget({
38                 fmClass : 'ccvm',
39                 fmField : 'ctype',
40                 parentNode : dojo.byId('attr-def-div')
41             });
42
43             selector.build(
44                 function(w, ww) {
45                     dojo.connect(w, 'onChange', 
46                         function(newVal) {
47                             ccvmGrid.resetStore();
48                             ccvmGrid.loadAll({order_by : {ccvm : 'code'}}, {ctype : newVal});
49                             ccvmGrid.overrideWidgetArgs.ctype = {dijitArgs : {value : newVal}};
50                             // ^-- why is this not working?
51                         }
52                     );
53                 }
54             );
55
56             // hide the progress indicator since we're not loading any data up front
57             dojo.style(ccvmGrid.loadProgressIndicator, 'visibility', 'hidden');
58         }
59     );
60
61 </script>
62
63 [% END %]