[open-ils-commits] r10112 - trunk/Open-ILS/web/js/dojo/fieldmapper
svn at svn.open-ils.org
svn at svn.open-ils.org
Thu Jul 24 11:04:12 EDT 2008
Author: miker
Date: 2008-07-24 11:04:05 -0400 (Thu, 24 Jul 2008)
New Revision: 10112
Modified:
trunk/Open-ILS/web/js/dojo/fieldmapper/dojoData.js
trunk/Open-ILS/web/js/dojo/fieldmapper/hash.js
Log:
backporting virtual field support from acq branch
Modified: trunk/Open-ILS/web/js/dojo/fieldmapper/dojoData.js
===================================================================
--- trunk/Open-ILS/web/js/dojo/fieldmapper/dojoData.js 2008-07-24 15:00:12 UTC (rev 10111)
+++ trunk/Open-ILS/web/js/dojo/fieldmapper/dojoData.js 2008-07-24 15:04:05 UTC (rev 10112)
@@ -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: trunk/Open-ILS/web/js/dojo/fieldmapper/hash.js
===================================================================
--- trunk/Open-ILS/web/js/dojo/fieldmapper/hash.js 2008-07-24 15:00:12 UTC (rev 10111)
+++ trunk/Open-ILS/web/js/dojo/fieldmapper/hash.js 2008-07-24 15:04:05 UTC (rev 10112)
@@ -29,7 +29,7 @@
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) {
@@ -39,6 +39,14 @@
_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