Here is a fork of code that nemesv wrote:
There is a parent node and nested children.
Here is a sample of the parent/child node:
function FormElementNode(children, text, value) {
var self = this;
self.children = ko.observableArray(children);
self.text = ko.observable(text);
self.value = ko.observable(value);
}
And here is the structure of the HTML (without the script tags)
<ul>
<li>Parent text value:
Children:
<ul>
<li>Child1 text value</li>
<li>Child2 text value</li>
</li>
I need to be able to select a node by mouse-clicking it (in effect, select one of the li-tags via a mouse click); then press the delete button to remove it (last line of the code). How can I do that?