[open-ils-commits] r13096 - in trunk/Open-ILS/web/vandelay: . inc (erickson)

svn at svn.open-ils.org svn at svn.open-ils.org
Wed May 6 21:22:04 EDT 2009


Author: erickson
Date: 2009-05-06 21:22:03 -0400 (Wed, 06 May 2009)
New Revision: 13096

Modified:
   trunk/Open-ILS/web/vandelay/inc/matches.xml
   trunk/Open-ILS/web/vandelay/vandelay.js
Log:
moved match grid to DataGrid

Modified: trunk/Open-ILS/web/vandelay/inc/matches.xml
===================================================================
--- trunk/Open-ILS/web/vandelay/inc/matches.xml	2009-05-07 00:39:24 UTC (rev 13095)
+++ trunk/Open-ILS/web/vandelay/inc/matches.xml	2009-05-07 01:22:03 UTC (rev 13096)
@@ -34,6 +34,7 @@
         onclick="displayGlobalDiv('vl-queue-div');">&#x2196; &vandelay.back.to.import.queue;</button>
 </div>
 <div class='tall'>
-    <div dojoType='dojox.Grid' jsId='vlMatchGrid'> </div>
+    <table dojoType='dojox.grid.DataGrid' jsId='vlMatchGrid' query='{id:"*"}'> 
+    </table>
 </div>
 

Modified: trunk/Open-ILS/web/vandelay/vandelay.js
===================================================================
--- trunk/Open-ILS/web/vandelay/vandelay.js	2009-05-07 00:39:24 UTC (rev 13095)
+++ trunk/Open-ILS/web/vandelay/vandelay.js	2009-05-07 01:22:03 UTC (rev 13096)
@@ -15,18 +15,17 @@
 dojo.require("dojo.parser");
 dojo.require("dojo.io.iframe"); 
 dojo.require("dijit.ProgressBar"); 
-dojo.require("dijit.form.Button"); 
 dojo.require("dijit.form.FilteringSelect"); 
 dojo.require("dijit.layout.ContentPane");
 dojo.require("dijit.layout.TabContainer");
 dojo.require("dijit.layout.LayoutContainer");
 dojo.require('dijit.form.Button');
+dojo.require('dijit.form.CheckBox');
 dojo.require('dijit.Toolbar');
 dojo.require('dijit.Tooltip');
 dojo.require('dijit.Menu');
 dojo.require("dijit.Dialog");
 dojo.require("dojo.cookie");
-dojo.require("dojox.grid.Grid");
 dojo.require('dojox.grid.DataGrid');
 dojo.require("dojo.data.ItemFileReadStore");
 dojo.require('dojo.date.locale');
@@ -38,7 +37,6 @@
 dojo.require('openils.Event');
 dojo.require('openils.Util');
 dojo.require('openils.MarcXPathParser');
-dojo.require('openils.GridColumnPicker');
 dojo.require('openils.widget.GridColumnPicker');
 
 
@@ -395,8 +393,7 @@
                 displayGlobalDiv('vl-match-div');
                 resetVlMatchGridLayout();
                 currentMatchedRecords = recs;
-                if(!vlMatchGrid.structure)
-                    vlMatchGrid.setStructure(vlMatchGridLayout);
+                vlMatchGrid.setStructure(vlMatchGridLayout);
 
                 // build the data store of records with match information
                 var dataStore = bre.toStoreData(recs, null, 
@@ -429,9 +426,7 @@
 
 function vlPopulateMatchGrid(grid, data) {
     var store = new dojo.data.ItemFileReadStore({data:data});
-    var model = new dojox.grid.data.DojoData(
-        null, store, {rowsPerPage: 100, clientSort: true, query:{id:'*'}});
-    grid.setModel(model);
+    grid.setStore(store);
     grid.update();
 }
 
@@ -545,10 +540,9 @@
     return dojo.date.locale.format(date, {selector:'date'});
 }
 
-function vlGetCreator(rowIdx) {
-    data = this.grid.model.getRow(rowIdx);
-    if(!data) return '';
-    var id = data.creator;
+function vlGetCreator(rowIdx, item) {
+    if(!item) return '';
+    var id = this.grid.store.getValue(item, 'creator');
     if(userCache[id])
         return userCache[id].usrname();
     var user = fieldmapper.standardRequest(
@@ -564,16 +558,16 @@
     return this.value.replace('RECID', this.grid.store.getValue(item, 'id'));
 }
 
-function vlGetOverlayTargetSelector(rowIdx) {
-    data = this.grid.model.getRow(rowIdx);
-    if(data) {
-        var value = this.value.replace(/GRIDID/g, data._id);
-        value = value.replace(/RECID/g, currentImportRecId);
-        value = value.replace(/ID/g, data.id);
-        if(data._id == currentOverlayRecordsMapGid[currentImportRecId])
-            return value.replace('/>', 'checked="checked"/>');
-        return value;
-    }
+function vlGetOverlayTargetSelector(rowIdx, item) {
+    if(!item) return '';
+    var _id = this.grid.store.getValue(item, '_id');
+    var id = this.grid.store.getValue(item, 'id');
+    var value = this.value.replace(/GRIDID/g, _id);
+    value = value.replace(/RECID/g, currentImportRecId);
+    value = value.replace(/ID/g, id);
+    if(_id == currentOverlayRecordsMapGid[currentImportRecId])
+        return value.replace('/>', 'checked="checked"/>');
+    return value;
 }
 
 /**



More information about the open-ils-commits mailing list