1 /* Build maps of sre details for both display and selection purposes */
3 function build_sre_maps(grid) {
5 //grid.sre_id_map = {};
7 var parent_g = window.parent.parent.g;
9 var mfhd_details = parent_g.mfhd.details;
10 for (var i = 0; i < mfhd_details.length; i++) {
12 for (j in mfhd_details[i]) {
13 mfhd_detail[j] = mfhd_details[i][j];
16 entry.label = mfhd_detail.label + ' (' + (mfhd_detail.entryNum + 1) + ')';
17 entry.record_entry = mfhd_detail.id;
18 var org_unit_id = mfhd_detail.owning_lib;
19 //grid.sre_id_map[sre_id] = mfhd_detail;
20 if (!grid.sres_ou_map[org_unit_id]) {
21 grid.sres_ou_map[org_unit_id] =
23 "identifier": "record_entry",
28 grid.sres_ou_map[org_unit_id].items.push(entry);
31 for (i in grid.sres_ou_map) {
32 grid.sres_ou_map[i] = new dojo.data.ItemFileReadStore({
33 "data": grid.sres_ou_map[i]
43 function populate_sre_selector(grid, holding_lib_id, temp) {
44 if (grid.sres_ou_map[holding_lib_id]) {
45 grid.overrideEditWidgets.record_entry.attr
46 ("store", grid.sres_ou_map[holding_lib_id]);
47 grid.overrideEditWidgets.record_entry.shove = {};
48 grid.overrideEditWidgets.record_entry.attr("disabled", false);
49 // this is needed to reload the value after we change the store
50 // XXX is there a better way to do this?
51 grid.overrideEditWidgets.record_entry.setValue
52 (grid.overrideEditWidgets.record_entry._lastQuery);
54 grid.overrideEditWidgets.record_entry.attr
55 ("store", grid.empty_store);
56 grid.overrideEditWidgets.record_entry.attr("disabled", true);
57 grid.overrideEditWidgets.record_entry.attr("value", "");