ngx-tree-select icon indicating copy to clipboard operation
ngx-tree-select copied to clipboard

ExpandMode for only certain levels of the tree

Open Nokhoneryu opened this issue 7 years ago • 4 comments

I have a very specific case on my app, in which i need to have only the first level of the hierarchy expanded and all the other collapsed. Is it possible?

Nokhoneryu avatar Jan 31 '19 12:01 Nokhoneryu

Hi @Nokhoneryu,

now it's not possible and I don't have time to do this (frankly I don't have time to spend for OSS project since few month).

Crazyht avatar Jan 31 '19 14:01 Crazyht

Of course, but can you give me some hints on where i can tweak this to my project. I can then fork it so you can merge on the library if you want

Nokhoneryu avatar Jan 31 '19 15:01 Nokhoneryu

I think you need :

  • Add @input Parameter (i.e. ExpandLevel: number)
  • Add By Level Mode
  • add level parameter to setExpandForList (select.service.ts) with default value to 0 then you can handle you new mode depending of current recursion level

Crazyht avatar Jan 31 '19 15:01 Crazyht

Alright! I'll look into it! Many Thanks!

Nokhoneryu avatar Jan 31 '19 15:01 Nokhoneryu