I know how to dump data from the database into ui component table, but now I want to set data directly, how do I?. Is there a way to set data directly into ui component table without retrieving from the database?
Solved! Go to Solution.
As you mention you want to set data directly , you mean you have a form and want to store data in to table ? or its bit different ? - let us know in brief so its help us to trouble shoot the issue.
When I create a table with ui component in admin, the name of the column must be the same as the name of the field in the database so that the data in the database can be dumped into the table.
Now I have an array of data and I want to dump the data from that array into the table without using the database how to do?
sorry for my english not good
well , AKAIK there is no way to insert array using ui_component, if you wanted to do that then you need to create grid using block method.
and magento 2 have one method called insertMultiple - so you need to use that in grid - when you are creating grid using block method.
here i am sharing ref link for the same - https://webkul.com/blog/bulk-insert-table-magento-2/
this is my opinion and thought based on my experience