Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clearSelection is not working on single Tree #35

Open
krutika20 opened this issue May 22, 2020 · 4 comments
Open

clearSelection is not working on single Tree #35

krutika20 opened this issue May 22, 2020 · 4 comments

Comments

@krutika20
Copy link

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 krutika20 changed the title ClearSelection is not working on single Treeq ClearSelection is not working on single Tree May 22, 2020
@krutika20 krutika20 changed the title ClearSelection is not working on single Tree clearSelection is not working on single Tree May 22, 2020
@techiesalman
Copy link

@krutika20 Have you found any solution for this?

@modeverv
Copy link
Contributor

modeverv commented Oct 7, 2022

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
Copy link
Contributor

modeverv commented Oct 7, 2022

this weekend, I make PR...

@modeverv
Copy link
Contributor

modeverv commented Oct 7, 2022

I've made PR please check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants