2 <h1>[% l('Coded Value Maps') %]</h1> <br/>
4 <div dojoType="dijit.layout.ContentPane" layoutAlign="client" class='oils-header-panel'>
5 <div>[% l('Coded Value Maps') %]</div>
7 <button dojoType='dijit.form.Button' onClick='ccvmGrid.showCreateDialog()'>[% l('New Map') %]</button>
8 <button dojoType='dijit.form.Button' onClick='ccvmGrid.deleteSelected()'>[% l('Delete Selected') %]</button>
12 <div dojoType="dijit.layout.ContentPane" layoutAlign="client">
13 <span>[% l('Record Attribute Type: ') %]</span><div id='attr-def-div'></div>
16 <div dojoType="dijit.layout.ContentPane" layoutAlign="client">
17 <table jsId="ccvmGrid"
19 dojoType="openils.widget.AutoGrid"
20 fieldOrder="['ctype', 'code', 'value', 'description', 'opac_visible', 'search_label', 'is_simple', 'composite_def']"
22 defaultCellWidth='"25%"'
27 <tr><th field='composite_def'
28 get='getCompositeDefLink'
29 formatter='formatCompositeDefLink'>
30 [% l('Composite Definition') %]</th></tr>
35 <script type ="text/javascript">
37 dojo.require('dijit.form.FilteringSelect');
38 dojo.require('openils.widget.AutoGrid');
39 dojo.require('openils.widget.AutoFieldWidget');
41 function getCompositeDefLink(rowId, item) {
43 return this.grid.store.getValue(item, 'id');
46 var isComposite = false;
47 function formatCompositeDefLink(id) {
48 if (id && isComposite) {
49 return "<a href='" + oilsBasePath +
50 "/conify/global/config/composite_attr_entry_definition/"
51 + id + "'>Manage</a>";
57 openils.Util.addOnLoad(
60 var selector = new openils.widget.AutoFieldWidget({
63 parentNode : dojo.byId('attr-def-div')
68 dojo.connect(w, 'onChange',
71 // see if this attr def supports composite entries
73 onComplete : function(list) {
74 if (!list.length) return;
75 var comp = w.store.getValue(list[0], 'composite');
82 query : {name : ''+newVal}
85 ccvmGrid.resetStore();
86 ccvmGrid.loadAll({order_by : {ccvm : 'code'}}, {ctype : newVal});
87 ccvmGrid.overrideWidgetArgs.ctype = {dijitArgs : {value : newVal}};
88 // ^-- why is this not working?
94 // hide the progress indicator since we're not loading any data up front
95 dojo.style(ccvmGrid.loadProgressIndicator, 'visibility', 'hidden');