iVantage / angular-ivh-treeview

A treeview for AngularJS with filtering and checkbox support.
http://ivantage.github.io/angular-ivh-treeview/
MIT License
238 stars 89 forks source link

Used angular ivh treeview and ivh dropdown deselect only once working #197

Closed vasupotnuru closed 7 years ago

vasupotnuru commented 7 years ago

i have Used Like , when selectedItemsChanged Event fired for the first time deselect is working. from the next time it will not work. pls give me some suggestion . appModule.controller('MainCtrl', function($scope,ivhTreeviewMgr) { $scope.stuff = stuff; $scope.selectedItemsChanged = function(selectedItems1) { ivhTreeviewMgr.deselect(stuff, 'pens'); } }); http://jsbin.com/kotohu/edit In your example it is working fine. ivhTreeviewMgr with this.deselectGel = function() { // deselect by node reference ivhTreeviewMgr.deselect(stuff, 'pens'); };

jtrussell commented 7 years ago

Hi @vasupotnuru would you mind sharing an example on jsbin or codepen showing what you've tried? I'm not sure I completely understand the issue.

fhurta commented 7 years ago

Just guessing as I had similar issue - if you use any ivh options (e.g. non-default attributes name definition) directly in HTML (not overwriting the provider options) then you have to pass them to select() / deselect() functions too (both have optional options parameter). ivhTreeviewMgr does not know configuration of ivhTreeview instance if you do not pass it in.

Think of it as there is provider configuration (called global configuration) and you can have many treeview instances with different configuration, so the treeview instance configuration must be used with ivhTreeviewMgr methods.

If you have only single instance, you can put all your options into provider config as it is in the sample you mentioned.

vasupotnuru commented 7 years ago

hi , http://plnkr.co/edit/wOo98cSXa12rRLZO85lr?p=preview; i have used above example .here select and deselect operations working only once . is there any customization . pls help me

fhurta commented 7 years ago

I'm not sure I understand what exactly works and what not - what is user supposed to do in your sample and what is (not) expected result? If you mean you are not getting the cbChange event in the second drop down - you are missing the ivh-treeview-on-cb-change option there.

jtrussell commented 7 years ago

Thanks @fhurta!

@vasupotnuru, we can reopen if needed if that didn't solve your issue.