[open-ils-commits] r13116 - in trunk/Open-ILS/web: js/ui/default/conify/global/acq templates/default/conify/global/acq (erickson)
svn at svn.open-ils.org
svn at svn.open-ils.org
Sun May 10 20:55:41 EDT 2009
Author: erickson
Date: 2009-05-10 20:55:40 -0400 (Sun, 10 May 2009)
New Revision: 13116
Modified:
trunk/Open-ILS/web/js/ui/default/conify/global/acq/distribution_formula.js
trunk/Open-ILS/web/templates/default/conify/global/acq/distribution_formula.tt2
trunk/Open-ILS/web/templates/default/conify/global/acq/exchange_rate.tt2
Log:
added some grid autoheight handling. small bug fixes on creation. other small cleanup
Modified: trunk/Open-ILS/web/js/ui/default/conify/global/acq/distribution_formula.js
===================================================================
--- trunk/Open-ILS/web/js/ui/default/conify/global/acq/distribution_formula.js 2009-05-10 14:03:07 UTC (rev 13115)
+++ trunk/Open-ILS/web/js/ui/default/conify/global/acq/distribution_formula.js 2009-05-11 00:55:40 UTC (rev 13116)
@@ -3,40 +3,35 @@
dojo.require('openils.PermaCrud');
var formula;
var formCache = [];
+
function draw() {
+
if(formulaId) {
openils.Util.hide('formula-list-div');
drawFormulaSummary();
} else {
+
openils.Util.hide('formula-entry-div');
fListGrid.onPostCreate = function(fmObject) {
location.href = location.href + '/' + fmObject.id();
}
- fieldmapper.standardRequest(
- ['open-ils.acq', 'open-ils.acq.distribution_formula.ranged.retrieve'],
- { async: true,
- params: [openils.User.authtoken],
- onresponse: function (r) {
- var form = openils.Util.readResponse(r);
- formCache[form.id()] = form;
- fListGrid.store.newItem(form.toStoreItem());
- }
- }
- );
-
+
+ fieldmapper.standardRequest(
+ ['open-ils.acq', 'open-ils.acq.distribution_formula.ranged.retrieve'],
+ { async: true,
+ params: [openils.User.authtoken],
+ onresponse: function (r) {
+ var form = openils.Util.readResponse(r);
+ formCache[form.id()] = form;
+ fListGrid.store.newItem(form.toStoreItem());
+ }
+ }
+ );
+
}
}
openils.Util.addOnLoad(draw);
-/*function getFormulaId (rowIndex, item) {
- if(!item) return '';
- var pcrud = new openils.PermaCrud;
- var formulaName = pcrud.retrieve('acqdf', formulaId);
- return formulaName.name();
-
-
-}
-*/
function drawFormulaSummary() {
openils.Util.show('formula-entry-div');
dfeListGrid.overrideEditWidgets.formula = new
@@ -50,12 +45,9 @@
function getItemCount(rowIndex, item) {
if(!item) return '';
var form = formCache[this.grid.store.getValue(item, "id")];
+ if(!form) return 0;
var count = 0;
- dojo.forEach(form.entries(),
- function(e) {
- count = count + e.item_count();
- }
- );
+ dojo.forEach(form.entries(), function(e) { count = count + e.item_count(); });
return count;
}
Modified: trunk/Open-ILS/web/templates/default/conify/global/acq/distribution_formula.tt2
===================================================================
--- trunk/Open-ILS/web/templates/default/conify/global/acq/distribution_formula.tt2 2009-05-10 14:03:07 UTC (rev 13115)
+++ trunk/Open-ILS/web/templates/default/conify/global/acq/distribution_formula.tt2 2009-05-11 00:55:40 UTC (rev 13116)
@@ -5,7 +5,7 @@
<div id='formula-list-div'>
<div dojoType="dijit.layout.ContentPane" layoutAlign="client">
- <div dojoType="dijit.layout.ContentPane" layoutAlign="top" class='oils-header-panel'>
+ <div dojoType="dijit.layout.ContentPane" layoutAlign="client" class='oils-header-panel'>
<div>Distribution Formulas</div>
<div>
<button dojoType='dijit.form.Button' onClick='fListGrid.showCreateDialog()'>New Formula</button>
@@ -13,6 +13,7 @@
</div>
</div>
<table jsId="fListGrid"
+ autoHeight='true'
dojoType="openils.widget.AutoGrid"
fieldOrder="['id', 'name', 'owner', 'item_count', 'skip_count']"
query="{id: '*'}"
@@ -32,18 +33,19 @@
<div id='formula-entry-div'>
- <div dojoType="dijit.layout.ContentPane" layoutAlign="top">
+ <div dojoType="dijit.layout.ContentPane" layoutAlign="client">
<div id='formula-summary-pane'/>
</div>
- <div dojoType="dijit.layout.ContentPane" layoutAlign="top" class='oils-header-panel'>
+ <div dojoType="dijit.layout.ContentPane" layoutAlign="client" class='oils-header-panel'>
<div id="formula_head"></div>
<div>
<button dojoType='dijit.form.Button' onClick='dfeListGrid.showCreateDialog()'>New Formula Entry</button>
<button dojoType='dijit.form.Button' onClick='dfeListGrid.deleteSelected()'>Delete Selected</button>
</div>
</div>
- <div dojoType="dijit.layout.ContentPane" layoutAlign="client" style='height:400px'>
+ <div dojoType="dijit.layout.ContentPane" layoutAlign="client">
<table jsId="dfeListGrid"
+ autoHeight='true'
dojoType="openils.widget.AutoGrid"
fieldOrder="['id','formula', 'owning_lib', 'location', 'item_count', 'position']"
suppressFields="['formula']"
@@ -57,6 +59,7 @@
</tr>
</thead>
</table>
+ <div/>
</div>
</div>
</div>
Modified: trunk/Open-ILS/web/templates/default/conify/global/acq/exchange_rate.tt2
===================================================================
--- trunk/Open-ILS/web/templates/default/conify/global/acq/exchange_rate.tt2 2009-05-10 14:03:07 UTC (rev 13115)
+++ trunk/Open-ILS/web/templates/default/conify/global/acq/exchange_rate.tt2 2009-05-11 00:55:40 UTC (rev 13116)
@@ -14,8 +14,9 @@
<button dojoType='dijit.form.Button' onClick='erGrid.deleteSelected()'>Delete Selected</button>
</div>
</div>
-<div dojoType="dijit.layout.ContentPane" layoutAlign="client" style='height:600px;'>
+<div dojoType="dijit.layout.ContentPane" layoutAlign="client">
<table jsId="erGrid"
+ autoHeight='true'
dojoType="openils.widget.AutoGrid"
fieldOrder="['id', 'from_currency', 'to_currency', 'ratio']"
defaultCellWidth='12'
@@ -23,6 +24,7 @@
fmClass='acqexr'
editOnEnter='true'>
</table>
+ <div/>
</div>
[% END %]
More information about the open-ils-commits
mailing list