First, I would ask what the purpose of this list is. Is it a kind of order form where you can manually enter the desired products and then send it via form? Or is it more like a shop?
Depending on the answer, the implementation process could be completely different. It also depends on the theme you are using.
@threadi Thanks for your reply,
This table is for product and block is for cooking blog. So I put in, e.g.:
First field (product name) – Potato
Second field (quantity) – 500
Units – g
I have to add other product and I press button “Add” (circle with cross)
First field (product name) – Oil
Second field (quantity) – 200
Units – ml
And so on…
Then I memorize this table like array with objects:
[
{“product”: “potato”, “quantity”: “500”, “unit”: “g”},
{“product”: “oil”, “quantity”: “200”, “unit”: “ml”}
]
I think to do it that:
Product – TextControl component;
Quantity – TextControl component, but I need to convert it to number with Number() function or “+”
Units – TextControl, ok
But, how do I group it in row? What component I need to use?
Am I correct in understanding that you want to develop the block for this list yourself and are looking for suitable Gutenberg components? Because you posted your question in the “Fixing WordPress” forum, which is more about user questions than developer questions.
For developer questions, there is https://ww.wp.xz.cn/support/forum/wp-advanced/ or, more likely, https://wordpress.stackexchange.com.
The solution to your question would actually be the Group Block. However, I haven’t found any indication of which Gutenberg component can be used for this. Or maybe I overlooked it in the documentation: https://developer.ww.wp.xz.cn/block-editor/reference-guides/components/
You could also check with the Gutenberg team to see if you can find any information there. Or ask your question there: https://github.com/WordPress/gutenberg/issues
Ups, sorry. I didn’t see the topic. Can it move to “Developing with WordPress Forum”?
@threadi Thank you for your replies. Stack is good platform