Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMB2-grid group classes not working #44

Open
Sebaortiz opened this issue Jul 31, 2019 · 3 comments
Open

CMB2-grid group classes not working #44

Sebaortiz opened this issue Jul 31, 2019 · 3 comments

Comments

@Sebaortiz
Copy link

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...

@mathz
Copy link

mathz commented Aug 24, 2020

Seems like eklingen88 have a solution for this: #42

@pablo-sg-pacheco
Copy link
Member

Will merge it then,
Thanks

@mathz
Copy link

mathz commented Aug 24, 2020

I've really not tested it enough to say that it really works. I only wanted to inform others with similar problems that there may be a solution

belenski added a commit to belenski/CMB2-grid that referenced this issue May 3, 2021
This change will allow usage of the "class" option for the grouped fields
pablo-sg-pacheco added a commit that referenced this issue Dec 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants