combo-tree
combo-tree copied to clipboard
clearSelection is not working on single Tree
I have set single tree using below code. gunBtreeinstance = jq('#gunBrokerTree').comboTree({ source : data.categoryData, isMultiple: false }); and trying to reset filter of this comboTree using clearSelection but not wokring. gunBtreeinstance.clearSelection();
setSelection is also not working for resting filter like gunBtreeinstance.setSelection(['0']) or gunBtreeinstance.setSelection('0')
Please help for single tree. Thanks
@krutika20 Have you found any solution for this?
i wrote a code.
ComboTree.prototype.clearSelection = function () {
for (i = 0; i < this._selectedItems.length; i++) {
let itemElem = $(
'#' + this.comboTreeId + 'Li' + this._selectedItems[i].id
);
$(itemElem).find('input').prop('checked', false);
}
this._selectedItems = [];
this._selectedItem = {}; // !!! this line!!!
this.refreshInputVal();
};
this weekend, I make PR...
I've made PR please check.