[open-ils-commits] r12191 - trunk/Open-ILS/web/js/dojo/fieldmapper (erickson)
svn at svn.open-ils.org
svn at svn.open-ils.org
Mon Feb 16 13:55:14 EST 2009
Author: erickson
Date: 2009-02-16 13:55:09 -0500 (Mon, 16 Feb 2009)
New Revision: 12191
Modified:
trunk/Open-ILS/web/js/dojo/fieldmapper/IDL.js
Log:
in addition to the field list, provide a name-based hash for faster/simpler runtime lookup
Modified: trunk/Open-ILS/web/js/dojo/fieldmapper/IDL.js
===================================================================
--- trunk/Open-ILS/web/js/dojo/fieldmapper/IDL.js 2009-02-16 02:14:28 UTC (rev 12190)
+++ trunk/Open-ILS/web/js/dojo/fieldmapper/IDL.js 2009-02-16 18:55:09 UTC (rev 12191)
@@ -41,9 +41,12 @@
var id = node.getAttribute('id');
var fields = node.getElementsByTagName('fields')[0];
window.fmclasses[id] = [];
+
+ var fieldData = this._parseFields(node, id);
var obj = {
- fields : this._parseFields(node, id),
+ fields : fieldData.list,
+ field_map : fieldData.map,
name : node.getAttribute('id'),
//table : node.getAttributeNS(this.NS_PERSIST, 'tablename'),
//core : node.getAttributeNS(this.NS_REPORTS, 'core'),
@@ -92,6 +95,7 @@
/* parses the links and fields portion of the IDL */
_parseFields : function(node, classname) {
var data = [];
+ var map = {};
var fields = node.getElementsByTagName('fields')[0];
fields = fields.getElementsByTagName('field');
@@ -139,6 +143,7 @@
}
data.push(obj);
+ map[obj.name] = obj;
}
/*
@@ -151,7 +156,7 @@
);
*/
- return data;
+ return { list : data, map : map };
}
});
More information about the open-ils-commits
mailing list