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?
ExpressionEngine® Answers is a question and answer site for administrators, end users, developers and designers for ExpressionEngine® CMS. It only takes a minute to sign up.Sign up to join this community
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.