how to set value on the data which are not shown in the grid

hi:
I am trying to set value on the fields which are not shown in the grid.
I tried the ‘add-field’ method to set value, how could I set the field with the value I want.
For example: add_field(“a”,“1”); //but i want “1” come from another grid.how could i get the value and could anyone explain “extra data”. I’ve read the api ,and can not understand it clearly,please give me a example.
best regards

You need to have some extra data on client side, which will store such extra info, for example , on client side

//need to be executed before saving start grid.setUserData(some_id, "clientA", othergrid.getSelectedRowId());

In such case on server side you will be able to use

$action->add_field("a",action->get_value("clientA"));

:laughing: thank you for you help.
when i use render_table(),do i need to set extraData.

Nope, extra data in “render” command is necessary when you want fetch something from DB, you need not any extra command for receiving extra info from a client side code.