If you try Javascript on 3.0, I would suggest you use the Jquery build in function: Refer here for grids and
here for getting the value of the field
You can also use trigger to do it but it must be set on the 2nd Form, Before Dynaform.
You can refer to this code: (You have Item, Amount and Vendor as a ordinary field in the 1st Dynaform and wants it to be in the grid in the second)
$item = @@item;
$amount = @@amount;
$vendor = @@vendor;
@=grid_item = array(
1 => array('item'=>$item, 'amount'=>$amount, 'vendor' => $vendor)
);
For Javascript:
var item= $("#item").getValue();
var amount= $("#amount").getValue();
var vendor = $("#amount").getValue();
//inserting value in the grid
//jQuery("#grid").setValue(value, row, col); syntax
jQuery("#grid_item").setValue(item, '1', '1');
jQuery("#grid_item").setValue(amount, '1', '2');
jQuery("#grid_item").setValue(vendor, '1', '3');
To make it more efficient in the JS process, use loop and all my codes are subject for debugging as I just create my code base on the wiki.