]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/web/templates/default/conify/global/config/coded_value_map.tt2
added crad config UI
[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     var firstRun = true;
35     openils.Util.addOnLoad(
36         function() {
37
38             var selector = new openils.widget.AutoFieldWidget({
39                 fmClass : 'ccvm',
40                 fmField : 'ctype',
41                 parentNode : dojo.byId('attr-def-div')
42             });
43
44             selector.build(
45                 function(w, ww) {
46                     dojo.connect(w, 'onChange', 
47                         function(newVal) {
48                             ccvmGrid.resetStore();
49                             ccvmGrid.loadAll({order_by : {ccvm : 'code'}}, {ctype : newVal});
50                         }
51                     );
52                     // start with something arbitrary that has some data
53                     w.attr('value', 'audience'); 
54                 }
55             );
56         }
57     );
58
59 </script>
60
61 [% END %]