I looked at the documentation in ExpressionEngine about saving/updating a channel entry row.
Unfortunately, the documentation doesn't show anything about adding a new Grid row.
Is it possible to do this? If so, how?
I looked at the documentation in ExpressionEngine about saving/updating a channel entry row.
Unfortunately, the documentation doesn't show anything about adding a new Grid row.
Is it possible to do this? If so, how?
I hope this still helps,
I add new rows to a grid field by this code:
$data['field_id_X']['rows']['new_row_Y']['col_id_Z'] = 'value';
Just match X to your grid's field ID, increment new_row_Y as needed and match up your col_id_Z numbers.
I'm not really sure if it's possible to do this in a native way with the Channel Entries API, if someone knows a way please post.
However, I believe you can do grid field updates in your add-ons by using the EE Database Class and inserting/updating the corresponding grid table directly with a mysql query.
If you examine your database tables, you will see that grid fields create their own tables, named exp_channel_grid_field_##
(where ## is your field number).
You'll also see that each exp_channel_grid_field_##
entry is associated by entry_id to the corresponding channel_title entry_id, and each column_id_#
is for the corresponding column you've set within the grid.