Closed ThisIsMyFavouriteJar closed 3 years ago
Hi, the "flatten" parameter is responsible for this option. By default in vue-treeselect flatten is disabled. In my package flatten is enabled.
I'll try to explain:
-- Wallpapers [1] --- Brands [2] ---- Some Brand [3]
When we has structure as in example and select "Wallpapers", visual selected will be three categories but attached will be only "Wallpapers[1]".
-- Wallpapers [1] --- Brands [2] ---- Some Brand [3] ---- Another Brand [4]
When we has structure as in this example and select "Some Brand[3]" attached will be "Some Brand[3]"
But if we select Some Brand [3] and Another Brand [4] attached will be Wallpapers [1].
After tests I enable flatten to avoid confusion when saving.
If you need the behavior that I described above, write message and I will add method for change it.
Hi @phoenix-lib , thank you for the explanation! If it would not be too much effort I would really like to be able to adjust the "flatten" setting from within the options!
Hi, added method withFlatten - you can use it
Upgrade to 1.4.2 version
Works great! Thanks for the effort!
Hello, have been experimenting with this package and I really like it so far! I currently run into the following problem though. When I select a parent this does not result in the selection of the children, which does seem to be the case at the documentation of Vue Treeselect. https://vue-treeselect.js.org/#basic-features
When I select "Parent" I expect the children to be selected as well. Currently I have this:
My db structure looks like this:
And my code like this:
NestedTreeAttachManyField::make('Offer Categories',"fields","App\Nova\TemplateField") ->searchable(true) ->withChildrenKey('children') ->withAlwaysOpen(true) ->withActiveKey(true)
I could not find anything in the documentation about this. Is this possible, or am I doing something wrong? Cheers!