[open-ils-commits] r9735 - in branches/acq-experiment/Open-ILS/web:
js/dojo/openils/acq
oilsweb/oilsweb/public/oils/media/ui_js/oils/default/common
oilsweb/oilsweb/templates/oils/default/common
svn at svn.open-ils.org
svn at svn.open-ils.org
Thu May 29 22:17:15 EDT 2008
Author: djfiander
Date: 2008-05-29 22:17:14 -0400 (Thu, 29 May 2008)
New Revision: 9735
Modified:
branches/acq-experiment/Open-ILS/web/js/dojo/openils/acq/Lineitems.js
branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/ui_js/oils/default/common/jubgrid.js
branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/common/jubgrid.html
Log:
Properly update acqlid grid after adding/deleting an acqlid
Modified: branches/acq-experiment/Open-ILS/web/js/dojo/openils/acq/Lineitems.js
===================================================================
--- branches/acq-experiment/Open-ILS/web/js/dojo/openils/acq/Lineitems.js 2008-05-30 02:10:43 UTC (rev 9734)
+++ branches/acq-experiment/Open-ILS/web/js/dojo/openils/acq/Lineitems.js 2008-05-30 02:17:14 UTC (rev 9735)
@@ -139,8 +139,10 @@
params: [openils.User.authtoken, lid],
oncomplete: function(r) {
var msg = r.recv();
+
+ fields.id = msg.content();
if (onCreateComplete) {
- onCreateComplete(lid);
+ onCreateComplete(fields);
}
}
});
Modified: branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/ui_js/oils/default/common/jubgrid.js
===================================================================
--- branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/ui_js/oils/default/common/jubgrid.js 2008-05-30 02:10:43 UTC (rev 9734)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/ui_js/oils/default/common/jubgrid.js 2008-05-30 02:17:14 UTC (rev 9735)
@@ -102,15 +102,22 @@
var updateCount = function(item) {
var newval = JUBGrid.jubGrid.model.store.getValue(item, "item_count");
JUBGrid.jubGrid.model.store.setValue(item, "item_count", newval-1);
- JubGrid.jubGrid.update();
+ JUBGrid.jubGrid.update();
};
JUBGrid.jubGrid.model.store.fetch({query:{id:JUBGrid.jubDetailGrid.lineitemID},
onItem: updateCount});
}
},
- createLID: function(evt) {
- console.dir(evt);
+
+ createLID: function(fields) {
+ fields['lineitem'] = JUBGrid.jubDetailGrid.lineitemID;
+ var addToStore = function () {
+ JUBGrid.jubDetailGrid.model.store.newItem(fields);
+ JUBGrid.jubGrid.update();
+ JUBGrid.jubGrid.refresh();
+ }
+ openils.acq.Lineitems.createLID(fields, addToStore);
},
};
Modified: branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/common/jubgrid.html
===================================================================
--- branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/common/jubgrid.html 2008-05-30 02:10:43 UTC (rev 9734)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/common/jubgrid.html 2008-05-30 02:17:14 UTC (rev 9735)
@@ -70,13 +70,6 @@
},
]]
}];
-
- function createLID(fields) {
- fields['lineitem'] = JUBGrid.jubDetailGrid.lineitemID;
- openils.acq.Lineitems.createLID(fields,
- function (lidId) {
- });
- }
</script>
<div id="${domprefix + '-container'}"
@@ -90,7 +83,7 @@
<div dojoType="dijit.form.DropDownButton">
<span>${_('New Copy')}</span>
<div dojoType="dijit.TooltipDialog"
- execute="createLID(arguments[0]);">
+ execute="JUBGrid.createLID(arguments[0]);">
<script type='dojo/connect' event='onOpen'>
globalUser.buildPermOrgSelector('MANAGE_FUND', copyOwnerSelect);
openils.acq.Fund.buildPermFundSelector('MANAGE_FUND', acqlidFund);
More information about the open-ils-commits
mailing list