[open-ils-commits] r10106 -
branches/acq-experiment/Open-ILS/web/js/dojo/fieldmapper
svn at svn.open-ils.org
svn at svn.open-ils.org
Wed Jul 23 16:37:00 EDT 2008
Author: miker
Date: 2008-07-23 16:36:51 -0400 (Wed, 23 Jul 2008)
New Revision: 10106
Modified:
branches/acq-experiment/Open-ILS/web/js/dojo/fieldmapper/dojoData.js
branches/acq-experiment/Open-ILS/web/js/dojo/fieldmapper/hash.js
Log:
add support for dojo data store virtual fields
Modified: branches/acq-experiment/Open-ILS/web/js/dojo/fieldmapper/dojoData.js
===================================================================
--- branches/acq-experiment/Open-ILS/web/js/dojo/fieldmapper/dojoData.js 2008-07-23 20:15:52 UTC (rev 10105)
+++ branches/acq-experiment/Open-ILS/web/js/dojo/fieldmapper/dojoData.js 2008-07-23 20:36:51 UTC (rev 10106)
@@ -48,7 +48,7 @@
var data = { label : label, identifier : params.identifier, items : [] };
- for (var i in list) data.items.push( list[i].toHash(true) );
+ for (var i in list) data.items.push( list[i].toHash(true, params.virtualFields) );
if (params.children && params.parent) {
var _hash_list = data.items;
Modified: branches/acq-experiment/Open-ILS/web/js/dojo/fieldmapper/hash.js
===================================================================
--- branches/acq-experiment/Open-ILS/web/js/dojo/fieldmapper/hash.js 2008-07-23 20:15:52 UTC (rev 10105)
+++ branches/acq-experiment/Open-ILS/web/js/dojo/fieldmapper/hash.js 2008-07-23 20:36:51 UTC (rev 10106)
@@ -29,16 +29,24 @@
return this;
}
- function _toHash (includeNulls) {
+ function _toHash (includeNulls, virtFields) {
var _hash = {};
for ( var i=0; i < this._fields.length; i++) {
if (includeNulls || this[this._fields[i]]() != null) {
if (this[this._fields[i]]() == null)
- _hash[this._fields[i]] = null;
- else
- _hash[this._fields[i]] = '' + this[this._fields[i]]();
- }
+ _hash[this._fields[i]] = null;
+ else
+ _hash[this._fields[i]] = '' + this[this._fields[i]]();
+ }
}
+
+ if (virtFields && virtFields.length > 0) {
+ for (var i in virtFields) {
+ if (!_hash[virtFields[i]])
+ _hash[virtFields[i]] = null;
+ }
+ }
+
return _hash;
}
More information about the open-ils-commits
mailing list