.text() is equivalent to the DOM's innerText attribute, which is defined by the W3C as the text of all children of the node in question. Since the JS Tree is a set of nested
and
elements, you get all of the children of the
, including any nested
and
. If you want just the label for an entry in the JS Tree, you should be able to do SemantEcoUI.HierarchicalFacet.entryForElement(data.o).prefLabel
[9:17:53 PM] Brendan: Hmm
[9:18:21 PM] Brendan: // handle source object having children
if (data.o.hasClass("jstree-open")) {
var payload = $.trim($(data.o.find('a.jstree-clicked')).text());
} else {
var payload = $.trim($(data.o).text());
}
[9:18:24 PM] Brendan: is what i did
[9:18:56 PM] Brendan: if it is open we are working with an open item with children so I get it based off the clicked one
[9:19:02 PM] Brendan: else I can just do the normal method
[9:19:07 PM] Brendan: I tested it seemd to work
[9:19:20 PM] apseyed: hey Tim
[9:19:27 PM] apseyed: "The URI for the LayerDataset is created by combining the values of base_uri, dataset_identifer, version_identifer, and enhancement_identifier."
[9:19:34 PM] apseyed: where does the base-uri come from?
[9:19:36 PM] Evan Patton: except, jstrees are multiple-select so if they ever select multiple items then that code will yield the concatenation of all the strings of selected tags.
[9:19:55 PM] Brendan: oh never did a multi select
[9:20:03 PM] Brendan: a user case I didnt consider
[9:20:06 PM] apseyed: should we just have an entry for base uri in the same box as the source, dataset, version boxes ?
[9:20:19 PM] Brendan: ill work on this later making an issue for now
Basically we use a way of parsing the object that is passed in Data.o but we need to consider corner cases so use the actual API in SemantEco.js core files. The "API". Not needed by current milestone.
.text() is equivalent to the DOM's innerText attribute, which is defined by the W3C as the text of all children of the node in question. Since the JS Tree is a set of nested
and- elements, you get all of the children of the
- , including any nested
and- . If you want just the label for an entry in the JS Tree, you should be able to do SemantEcoUI.HierarchicalFacet.entryForElement(data.o).prefLabel
[9:17:53 PM] Brendan: Hmm
[9:18:21 PM] Brendan: // handle source object having children
if (data.o.hasClass("jstree-open")) {
var payload = $.trim($(data.o.find('a.jstree-clicked')).text());
} else {
var payload = $.trim($(data.o).text());
}
[9:18:24 PM] Brendan: is what i did
[9:18:56 PM] Brendan: if it is open we are working with an open item with children so I get it based off the clicked one
[9:19:02 PM] Brendan: else I can just do the normal method
[9:19:07 PM] Brendan: I tested it seemd to work
[9:19:20 PM] apseyed: hey Tim
[9:19:27 PM] apseyed: "The URI for the LayerDataset is created by combining the values of base_uri, dataset_identifer, version_identifer, and enhancement_identifier."
[9:19:34 PM] apseyed: where does the base-uri come from?
[9:19:36 PM] Evan Patton: except, jstrees are multiple-select so if they ever select multiple items then that code will yield the concatenation of all the strings of selected tags.
[9:19:55 PM] Brendan: oh never did a multi select
[9:20:03 PM] Brendan: a user case I didnt consider
[9:20:06 PM] apseyed: should we just have an entry for base uri in the same box as the source, dataset, version boxes ?
[9:20:19 PM] Brendan: ill work on this later making an issue for now