KeyValue - Form Builder - Fields
I was thinking about the “key value” component, would there be a possibility of modifying it so that it would be possible to add other columns?
I know that the purpose of this component is very specific, but with this change it could help solve many other types of user data capture situations.
Has anyone here experienced this and have any solutions or suggestions to help me?
Thank you so much.
I'm waiting.
9 Replies
Why not Repeater?
How repeater could help in creating columns and rows dynamically?
Key value is exactly what it sounds like. It’s an array of keys and values. So if you need to add more complex structure then you need something like a repeater where the value can be more structured than a string.
Thanks for the tips so far, but think with me:
Let's say the user could choose how many columns to add and have the possibility to include the rows as they exist in the key-value.
How could I apply this idea with repeater?
Users are familiar with Excel, so the ease of including data in cells would facilitate the user's experience.
Fair, but you have to consider the right tool for the job. But it seems like you need more flexibility for the outcome, which is the difference between a key/value and a repeater. But it is also entirely possibly that you need some kind of hybrid, in which case you would need to reach for a custom field that does exactly what you need it to do.
Don’t be afraid to reach outside the box if it benefits your app or business logic. It’s still just laravel and livewire.
I've already used the form builder with a repeater for other situations that fit like a glove.
But this very specific situation maybe just creating a custom component using livewire and blade
Ok. You just answered your question. It’s a very specific need so a custom form field is need to solve your “very specific” situation. 😀
Worse thing you can do is shoehorn something designed for a specific use case into your specific use case.
It’ll be a waste of time. Don’t back out of something you can build forward.
It's not that specific but that's ok, I understand your point of view, I just realized that if there was a component with the similar process of key-result but in addition to multi-rows it would have the option of multi-columns, that alone would solve the problem.
The idea is to actually have a new form field, it has nothing to do with changing the purpose of the key-result, I know that it has exactly one specific function. Thank you for your support so far. Now I have accepted the challenge of creating a new component based on the idea. I am even checking the key-result base code to modify it for this purpose.
thank's for your time
Well, that’s exactly what a repeater is. Just saying.