Skip to content

CMB2-grid group classes not working  #44

@Sebaortiz

Description

@Sebaortiz

Hi!
I have a CMB2 Group and want to use Grid with class for the group fields but it shows me an error

Code for grid

$cmb2Grid = new \Cmb2Grid\Grid\Cmb2Grid($cmb_options);
$cmb2GroupGrid = $cmb2Grid->addCmb2GroupGrid($group_field_id);
$row           = $cmb2GroupGrid->addRow();
$row->addColumns(array(array($field1, 'class' => 'col-md-6'), array($field2, 'class' => 'col-md-6')));
$row = $cmb2Grid->addRow();
$row->addColumns(array($cmb2GroupGrid));

ERROR:
Argument 1 passed to Cmb2Grid\Grid\Group\GroupRow::openGroupRow() must be an instance of CMB2_Field, boolean given, called in C:\htdocs\site\wp-content\plugins\grid\Grid\Group\GroupRow.php on line 60 and defined in C:\htdocs\site\wp-content\plugins\grid\Grid\Group\GroupRow.php on line 47

Can someone please tell me what's wrong and what is the right way to do it?

Waiting for your reply...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions