return false;
}
-function newSearch(query, sort, targets)
+function newSearch(query, sort, targets, windowid)
{
debug("newSearch: " + query);
}
mkws.filters = []
- redraw_navi();
- resetPage();
- loadSelect();
- triggerSearch(query, sort, targets);
+ redraw_navi(); // ### should use windowid
+ resetPage(); // ### the globals it resents should be indexed by windowid
+ loadSelect(); // ### should use windowid
+ triggerSearch(query, sort, targets, windowid);
mkws.switchView('records'); // In case it's configured to start off as hidden
submitted = true;
}
totalRec = 0;
}
-function triggerSearch (query, sort, targets)
+function triggerSearch (query, sort, targets, windowid)
{
var pp2filter = "";
var pp2limit = "";
function run_auto_searches() {
- debug("run auto searches");
+ debug("running auto searches");
- var node = $('#mkwsRecords');
- if (node.attr('autosearch')) {
+ $('[id^="mkwsRecords"]').each(function () {
+ var node = $(this);
var query = node.attr('autosearch');
- var sort = node.attr('sort');
- var targets = node.attr('targets');
- var s = "running auto search: '" + query + "'";
- if (sort) s += " sorted by '" + sort + "'";
- if (targets) s += " in targets '" + targets + "'";
- debug(s);
- newSearch(query, sort, targets);
- }
+
+ if (query) {
+ var windowid = undefined;
+ var id = node.attr('id');
+ if (id.match(/^mkwsRecords_/, '')) {
+ windowid = id.replace(/^mkwsRecords_/, '');
+ }
+
+ var sort = node.attr('sort');
+ var targets = node.attr('targets');
+ var s = "running auto search: '" + query + "'";
+ if (windowid) s += " [windowid '" + windowid + "']";
+ if (sort) s += " sorted by '" + sort + "'";
+ if (targets) s += " in targets '" + targets + "'";
+ debug(s);
+ newSearch(query, sort, targets, windowid);
+ }
+ });
}