-
Notifications
You must be signed in to change notification settings - Fork 69
Open
Description
I needed to get the parent text during the onChange event, so hacked the code using:
--- C:\git\combo-tree\comboTreePlugin.js 2022-03-14 16:43:17.000000000 -0700
+++ C:\git\myApp\static\Drop-Down-Combo-Tree\comboTreePlugin.js 2022-03-11 14:46:57.000000000 -0700
@@ -323,13 +323,15 @@
return false;
}
if ($(ctItem).data("selectable") == true) {
this._selectedItem = {
id: $(ctItem).attr("data-id"),
- title: $(ctItem).text()
+ title: $(ctItem).text(),
+ obj:$(ctItem),
+ parent: $(ctItem).closest('.ComboTreeItemParent').children('.comboTreeItemTitle')
};
let check = this.isItemInArray(this._selectedItem, this.options.source);
if (check) {
var index = this.isItemInArray(this._selectedItem, this._selectedItems);
if (index) {
@@ -344,13 +346,15 @@
};
ComboTree.prototype.singleItemClick = function (ctItem) {
if ($(ctItem).data("selectable") == true) {
this._selectedItem = {
id: $(ctItem).attr("data-id"),
- title: $(ctItem).text()
+ title: $(ctItem).text(),
+ obj:$(ctItem),
+ parent: $(ctItem).closest('.ComboTreeItemParent').children('.comboTreeItemTitle')
};
} // if selectable
this.refreshInputVal();
this.closeDropDownMenu();
};
@@ -404,13 +408,13 @@
}
this._elemInput.val(tmpTitle);
this._elemInput.trigger('change');
if (this.changeHandler)
- this.changeHandler();
+ this.changeHandler(this);
};
ComboTree.prototype.dropDownMenuHover = function (itemSpan, withScroll) {
this._elemItems.find('span.comboTreeItemHover').removeClass('comboTreeItemHover');
$(itemSpan).addClass('comboTreeItemHover');
this._elemHoveredItem = $(itemSpan);
Metadata
Metadata
Assignees
Labels
No labels