},
});
+dojo.declare('openils.editors.CopyLocationSelectEditor', dojox.grid.editors.Dijit, {
+ editorClass: "dijit.form.FilteringSelect",
+ createEditor: function(inNode, inDatum, inRowIndex) {
+ dojo.require('openils.CopyLocation');
+ var editor = new this.editorClass(this.getEditorProps(inDatum), inNode);
+ openils.CopyLocation.createStore(1, /* XXX how do we propagate arguments to the editor?? */
+ function(store) {
+ editor.store = new dojo.data.ItemFileReadStore({data:store});
+ editor.startup();
+ if(inDatum)
+ editor.setValue(inDatum);
+ }
+ );
+ return editor;
+ },
+});
+
}
+
if(!data || !data.provider) return;
return openils.acq.Provider.retrieve(data.provider).code();
},
+ getCopyLocation : function(rowIndex) {
+ var data = JUBGrid.jubDetailGrid.model.getRow(rowIndex);
+ if(!data || !data.location) return '';
+ return openils.CopyLocation.retrieve(data.location).name();
+ },
getLIDFundName : function(rowIndex) {
var data = JUBGrid.jubDetailGrid.model.getRow(rowIndex);
if (!data || !data.fund) return;
if(JUBGrid.showDetails) {
dojo.connect(gridWidget, "onRowClick",
function(evt) {
- var jub = model.getRow(evt.rowIndex);
- var grid;
+ var jub = model.getRow(evt.rowIndex);
+ var grid;
- JUBGrid.jubDetailGrid.lineitemID = jub.id;
+ JUBGrid.jubDetailGrid.lineitemID = jub.id;
- if (jub.state == "approved") {
- grid = JUBGrid.jubDetailGridLayoutReadOnly;
- } else {
- grid = JUBGrid.jubDetailGridLayout;
- }
- openils.acq.Lineitems.loadGrid(
+ if (jub.state == "approved") {
+ grid = JUBGrid.jubDetailGridLayoutReadOnly;
+ } else {
+ grid = JUBGrid.jubDetailGridLayout;
+ }
+ openils.acq.Lineitems.loadGrid(
JUBGrid.jubDetailGrid,
JUBGrid.jubGrid.model.getRow(evt.rowIndex).id, grid);
- });
+ }
+ );
}
gridWidget.update();
},
% endif
<script src='${c.oils.core.media_prefix.value}/ui_js/oils/default/common/jubgrid.js'> </script>
+ <script src='${c.oils.core.media_prefix.value}/js/dojo/openils/CopyLocation.js'> </script>
<script type="text/javascript">
JUBGrid.getPO = function(rowIndex) {
var data = JUBGrid.jubGrid.model.getRow(rowIndex);
editorClass: "dijit.form.TextBox"
},
{name:"Shelving Location", field:"location", width:'auto',
+ editor:openils.editors.CopyLocationSelectEditor,
+ get:JUBGrid.getCopyLocation
+ /*
editor:dojox.grid.editors.Dijit,
- editorClass: "dijit.form.TextBox"
+ editorClass: "dijit.form.FilteringSelect",
+ */
},
-
]]
}];