allow for definition of default cell width. (can still be overridden by defining...
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 5 Feb 2009 16:21:43 +0000 (16:21 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 5 Feb 2009 16:21:43 +0000 (16:21 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@12080 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/js/dojo/openils/widget/AutoGrid.js
Open-ILS/web/templates/default/conify/global/acq/exchange_rate.tt2

index 4c44d1e..b40e629 100644 (file)
@@ -13,6 +13,7 @@ if(!dojo._hasResource['openils.widget.AutoGrid']) {
 
             /* if true, pop up an edit dialog when user hits Enter on a give row */
             editOnEnter : false, 
+            defaultCellWidth : null,
 
             startup : function() {
 
@@ -33,6 +34,8 @@ if(!dojo._hasResource['openils.widget.AutoGrid']) {
                     fields.push(entry);
                     if(!entry.get) 
                         entry.get = openils.widget.AutoGrid.defaultGetter
+                    if(!entry.width && this.defaultCellWidth)
+                        entry.width = this.defaultCellWidth;
                 }
 
                 this.setStructure([{cells: [fields]}]);
index 8761c5e..bbf1c0a 100644 (file)
     }
     openils.Util.addOnLoad(renderGrid);
 </script>
-
-<style>
-
-.oils-header-panel {
-    width:99%;
-    margin-top:20px;
-}
-.oils-header-panel div:first-child {
-    width:48%;
-    text-align:left;
-    float:left;
-    font-size:130%;
-    font-weight: bold;
-    vertical-align:bottom;
-    position:relative;
-    bottom:0px;
-    left:5px;
-}
-.oils-header-panel div:last-child {
-    width:48%;
-    text-align:right;
-    float:right;
-    vertical-align:bottom;
-    position:relative;
-    bottom:0px;
-    right:5px;
-}
-</style>
-
 <div dojoType="dijit.layout.ContentPane" layoutAlign="top" class='oils-header-panel'>
     <div>Exchange Rates</div>
     <div><button dojoType='dijit.form.Button' onClick='erGrid.showCreateDialog()'>New</button></div>
@@ -57,7 +28,7 @@
 
 <div dojoType="dijit.layout.ContentPane" layoutAlign="client" style='height:600px;'>
     <table jsId="erGrid" dojoType="openils.widget.AutoGrid" 
-            fieldOrder="['id', 'from_currency', 'to_currency', 'ratio']" 
+            fieldOrder="['id', 'from_currency', 'to_currency', 'ratio']" defaultCellWidth='12'
             query="{id: '*'}" rowSelector='20px' fmClass='acqexr' editOnEnter='true'>
     </table>
 </div>