cancel
Showing results for 
Search instead for 
Did you mean: 

how to set data directly into ui component tables without retrieving from the database?

SOLVED

how to set data directly into ui component tables without retrieving from the database?

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? 

1 ACCEPTED SOLUTION

Accepted Solutions

Re: how to set data directly into ui component tables without retrieving from the database?

Hi @kasumo

 

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 

if issue solved,Click Kudos & Accept as Solution

View solution in original post

3 REPLIES 3

Re: how to set data directly into ui component tables without retrieving from the database?

Hi @kasumo

 

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.

if issue solved,Click Kudos & Accept as Solution

Re: how to set data directly into ui component tables without retrieving from the database?

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 Smiley Happy

Re: how to set data directly into ui component tables without retrieving from the database?

Hi @kasumo

 

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 

if issue solved,Click Kudos & Accept as Solution