combo-tree icon indicating copy to clipboard operation
combo-tree copied to clipboard

clearSelection is not working on single Tree

Open krutika20 opened this issue 4 years ago • 4 comments

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 avatar May 22 '20 05:05 krutika20

@krutika20 Have you found any solution for this?

techiesalman avatar May 19 '21 06:05 techiesalman

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();
  };

modeverv avatar Oct 07 '22 08:10 modeverv

this weekend, I make PR...

modeverv avatar Oct 07 '22 08:10 modeverv

I've made PR please check.

modeverv avatar Oct 07 '22 11:10 modeverv