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

Group Grid - Bootstrap Classes not working #8

Closed
ruturajpatki opened this issue Jan 11, 2016 · 2 comments
Closed

Group Grid - Bootstrap Classes not working #8

ruturajpatki opened this issue Jan 11, 2016 · 2 comments

Comments

@ruturajpatki
Copy link

Hi,

I have a CMB2 Group and want to use Grid for the group fields. Following code works without error...

$cluster_row = $clusterGroupGrid->addRow();
        $cluster_row->addColumns(array(
![2016-01-11_14-02-20](https://cloud.githubusercontent.com/assets/2541944/12229343/de848718-b86c-11e5-98fe-873c07b89336.jpg)

            $gField1, $gField2
        ));

But when I try to specify Bootstrap classes (like in the code below)...

$cluster_row = $clusterGroupGrid->addRow();
        $cluster_row->addColumns(array(
            array($gField1, 'class' => 'col-sm-4'),
            array($gField2, 'class' => 'col-sm-8'),
        ));

... I get following error:

Catchable fatal error: Argument 1 passed to Cmb2Grid\Grid\Group\GroupRow::openGroupRow() must be an instance of CMB2_Field, boolean given, called in cmb2grid\Grid\Group\GroupRow.php on line 56 and defined in cmb2grid\Grid\Group\GroupRow.php on line 45.

Can someone please tell me what's wrong and what is the right way to do it? I checked example file but it does not declare field array with Bootstrap Classes.

Waiting for your reply...

Cheers,

Ruturaaj.

UPDATE:
My IDE shows following error:
2016-01-11_14-02-20

@pablo-sg-pacheco
Copy link
Member

Hello. I'm afraid to say it doesn't support classes on group fields. :(
I'm sorry. I'll update the info later

@ruturajpatki
Copy link
Author

ruturajpatki commented Jun 1, 2016

Yes, you're right. It doesn't support classes on group fields. For group fields, you just need to create an array of CMB Fields and let the code decide which classes to apply in order to distribute the fields evenly.

I will wait for the author to update his plugin and add support for classes so we can decide how much to stretch a certain field by supplying number of columns to span it over.

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

2 participants