1 dojo.provide("openils.vandelay.TreeStoreModel");
2 dojo.require("dijit.tree.TreeStoreModel");
3 dojo.require("openils.Util");
5 /* This class specifically serves the eg/vandelay/match_set interface
6 * for editing Vandelay Match Set trees. It should probably have a more
7 * specific name that reflects that.
10 function _simple_item(model, item) {
11 /* Instead of model.getLabel(), could do
12 * model.store.getValue(item, "blah") or something like that ... */
13 var mp = model.store.getValue(item, "match_point");
19 "openils.vandelay.TreeStoreModel", dijit.tree.TreeStoreModel, {
21 "get_simple_tree": function(item, oncomplete, result) {
25 me = result = _simple_item(this, item);
27 me = _simple_item(this, item);
31 if (this.mayHaveChildren(item)) {
33 item, function(children) {
35 for (var i = 0; i < children.length; i++) {
36 self.get_simple_tree(children[i], null, kids_here);
38 me.children(kids_here);
39 if (oncomplete) oncomplete(result);
44 "mayHaveChildren": function(item) {
45 var match_point = this.store.getValue(item, "match_point");
47 return openils.Util.isTrue(match_point.bool_op());