[open-ils-commits] r13090 - in trunk/Open-ILS/web/vandelay: . inc (erickson)
svn at svn.open-ils.org
svn at svn.open-ils.org
Wed May 6 13:28:22 EDT 2009
Author: erickson
Date: 2009-05-06 13:28:20 -0400 (Wed, 06 May 2009)
New Revision: 13090
Modified:
trunk/Open-ILS/web/vandelay/inc/queue.xml
trunk/Open-ILS/web/vandelay/vandelay.js
Log:
moved queue grid to dojo.data.DataGrid plus some other dojo-istic updates. need to update the column picker
Modified: trunk/Open-ILS/web/vandelay/inc/queue.xml
===================================================================
--- trunk/Open-ILS/web/vandelay/inc/queue.xml 2009-05-06 14:46:47 UTC (rev 13089)
+++ trunk/Open-ILS/web/vandelay/inc/queue.xml 2009-05-06 17:28:20 UTC (rev 13090)
@@ -13,7 +13,6 @@
var vlQueueGridLayout;
function resetVlQueueGridLayout() {
vlQueueGridLayout = [{
- //defaultCell: {styles: 'text-align: center;'},
cells : [[
{name: '<input id="vl-queue-grid-row-selector" type="checkbox" onclick="vlToggleQueueGridSelect();"/>',
get: vlQueueGridDrawSelectBox, styles : 'text-align: center;' },
@@ -129,8 +128,15 @@
</div>
<!-- Queue Grid -->
- <div class='' style='height:87%;' dojoType="dijit.layout.ContentPane" layoutAlign='client'>
- <div dojoType='dojox.Grid' jsId='vlQueueGrid'> </div>
+ <div dojoType="openils.widget.GridColumnPicker" jsid="vlQueueGridMenu" style="display: none;" grid='vlQueueGrid'>
+ <div dojoType="dojox.widget.PlaceholderMenuItem" label="GridColumns"></div>
</div>
+ <div style='height:600px' dojoType="dijit.layout.ContentPane" layoutAlign='client'>
+ <!--
+ <table dojoType='dojox.grid.DataGrid' jsId='vlQueueGrid' query="{id:'*'}" headerMenu='vlQueueGridMenu'>
+ -->
+ <table dojoType='dojox.grid.DataGrid' jsId='vlQueueGrid' query="{id:'*'}">
+ </table>
+ </div>
</div>
Modified: trunk/Open-ILS/web/vandelay/vandelay.js
===================================================================
--- trunk/Open-ILS/web/vandelay/vandelay.js 2009-05-06 14:46:47 UTC (rev 13089)
+++ trunk/Open-ILS/web/vandelay/vandelay.js 2009-05-06 17:28:20 UTC (rev 13090)
@@ -39,6 +39,7 @@
dojo.require('openils.Util');
dojo.require('openils.MarcXPathParser');
dojo.require('openils.GridColumnPicker');
+dojo.require('openils.widget.GridColumnPicker');
var globalDivs = [
@@ -318,7 +319,7 @@
currentOverlayRecordsMap = {};
currentOverlayRecordsMapGid = {};
selectableGridRecords = {};
- resetVlQueueGridLayout();
+ //resetVlQueueGridLayout();
if(!type) type = currentType;
if(!queueId) queueId = currentQueueId;
@@ -328,10 +329,9 @@
if(vlQueueGridShowMatches.checked)
method = method.replace('records', 'records.matches');
- //var limit = parseInt(vlQueueDisplayLimit.getValue());
var sel = dojo.byId('vl-queue-display-limit-selector');
var limit = parseInt(sel.options[sel.selectedIndex].value);
- var offset = limit * parseInt(vlQueueDisplayPage.getValue()-1);
+ var offset = limit * parseInt(vlQueueDisplayPage.attr('value')-1);
var params = [authtoken, queueId, {clear_marc: 1, offset: offset, limit: limit}];
if(vlQueueGridShowNonImport.checked)
@@ -520,29 +520,28 @@
return null;
}
-function vlGetViewMatches(rowIdx) {
- var data = this.grid.model.getRow(rowIdx);
- if(!data) return '';
- var rec = queuedRecordsMap[data.id];
+function vlGetViewMatches(rowIdx, item) {
+ if(!item) return '';
+ var id = this.grid.store.getValue(item, 'id');
+ var rec = queuedRecordsMap[id];
if(rec.matches().length > 0)
- return this.value.replace('RECID', data.id);
+ return this.value.replace('RECID', id);
return '';
}
-function getAttrValue(rowIdx) {
- var data = this.grid.model.getRow(rowIdx);
- if(!data) return '';
+function getAttrValue(rowIdx, item) {
+ if(!item) return '';
var attrCode = this.field.split('.')[1];
- var rec = queuedRecordsMap[data.id];
+ var rec = queuedRecordsMap[this.grid.store.getValue(item, 'id')];
var attr = getRecAttrFromCode(rec, attrCode);
return (attr) ? attr.attr_value() : '';
}
-function vlGetDateTimeField(rowIdx) {
- data = this.grid.model.getRow(rowIdx);
- if(!data) return '';
- if(!data[this.field]) return '';
- var date = dojo.date.stamp.fromISOString(data[this.field]);
+function vlGetDateTimeField(rowIdx, item) {
+ if(!item) return '';
+ var value = this.grid.store.getValue(item, this.field);
+ if(!value) return '';
+ var date = dojo.date.stamp.fromISOString(value);
return dojo.date.locale.format(date, {selector:'date'});
}
@@ -560,10 +559,9 @@
return user.usrname();
}
-function vlGetViewMARC(rowIdx) {
- data = this.grid.model.getRow(rowIdx);
- if(data)
- return this.value.replace('RECID', data.id);
+function vlGetViewMARC(rowIdx, item) {
+ if(!item) return '';
+ return this.value.replace('RECID', this.grid.store.getValue(item, 'id'));
}
function vlGetOverlayTargetSelector(rowIdx) {
@@ -639,19 +637,22 @@
storeData = vqar.toStoreData(queuedRecords);
var store = new dojo.data.ItemFileReadStore({data:storeData});
- var model = new dojox.grid.data.DojoData(
- null, store, {rowsPerPage: 100, clientSort: true, query:{id:'*'}});
- vlQueueGrid.setModel(model);
+ vlQueueGrid.setStore(store);
+ vlQueueGrid.attr('structure', vlQueueGridLayout);
-
+ /*
if(vlQueueGridColumePicker[type]) {
vlQueueGrid.update();
} else {
vlQueueGridColumePicker[type] =
- new openils.GridColumnPicker(vlQueueGridColumePickerDialog,
- vlQueueGrid, vlQueueGridLayout, authtoken, 'vandelay.queue.'+type);
+ new vlQueueGridMenu.init({
+ grid : vlQueueGrid,
+ authtoken : authtoken,
+ persistPrefix : 'vandelay.queue.'+type
+ });
vlQueueGridColumePicker[type].load();
}
+ */
}
function vlQueueGridPrevPage() {
@@ -682,11 +683,11 @@
}
-function vlQueueGridDrawSelectBox(rowIdx) {
- var data = this.grid.model.getRow(rowIdx);
- if(!data) return '';
- var domId = 'vl-record-list-selected-' +data.id;
- selectableGridRecords[domId] = data.id;
+function vlQueueGridDrawSelectBox(rowIdx, item) {
+ if(!item) return '';
+ var id = this.grid.store.getValue(item, 'id');
+ var domId = 'vl-record-list-selected-' + id;
+ selectableGridRecords[domId] = id;
return "<div><input type='checkbox' id='"+domId+"'/></div>";
}
More information about the open-ils-commits
mailing list