Closed ivanBell199 closed 11 months ago
I'm happy you like the package! To fix the problem you mentioned, you can try using ->enableBranchNode(false)
or simply remove the method from the tree.
SelectTree::make('categories')
->relationship('categories', 'name', 'parent_id')
->enableBranchNode(false),
Thanks for such a quick reply! It seems I wasn't clear enough in my explanation. I have CategoryResource in my Filament project. Let's say I create category "Electronics" and then inside it "PCs". Then I go to the Edit page for "PCs". There I have the tree of categories in case I need to reassign parent. As you can see, "PCs" is present in this tree: Of course, it should be obvious that you can't set "PCs" as parent for itself. But for the sake of better UX I think it would be good to disable this option or remove from the tree. Unfortunately, I don't have enough coding skill to achieve that. So if you can give me a hint how to solve my problem, I will be very grateful :)
This is not currently supported. However, I'll check the possibility of implementing something similar to the following:
->hideOptions([3,5,7])
->disableOptions([3,5,7])
Sounds great, thank you!
Sounds great, thank you!
I just dropped version v3.1.9, and now you can disable options.
Works nicely! Thank you for your work!
I've done PR https://github.com/CodeWithDennis/filament-select-tree/pull/55 to add the code to hide options
->hideOptions([id])
Thank you for this package, it's great! I wanted to use it in my "Category" form to select the parent category. It's working very well, but I have one issue. When editing a category, it is included in the select tree. Of course, a category cannot be parent to itself. Is it possible to hide it from the tree or make it unclickable? Or maybe you would consider adding this feature to the package. Thanks again.