Comments (8)
Hello,
How are you using Cmb2-grid? Can you put your code here?
PS: Sou br tb :) Legal saber
from cmb2-grid.
for the test i'm using exactly the example of the link on the first comment
`$telefone = $cmb->add_field( array(
'name' => 'Telefone',
//'desc' => 'field description (optional)',
//'default' => 'standard value (optional)',
'id' => 'telefone',
'type' => 'text',
) );
$telefoneBg = $cmb->add_field( array(
'name' => __( 'Test Color Picker', 'myprefix' ),
//'desc' => __( 'field description (optional)' ),
'id' => 'telefoneBg',
'type' => 'colorpicker',
//'default' => '#bada55',
) );
$cmb2Grid = new \Cmb2Grid\Grid\Cmb2Grid($cmb);
$row = $cmb2Grid->addRow();
$row->addColumns(array($telefone, $telefoneBg));
`
to replicate you can paste the code above in line 142
from cmb2-grid.
Try to use the field id instead, like this:
$row->addColumns(array('telefone', 'telefoneBg'));
from cmb2-grid.
same thing with $row->addColumns(array('telefone', 'telefoneBg'));
from cmb2-grid.
Actually i don't know if cmb2-grid works on a page. I've only tested it as a metabox inside a custom post type. Can you try that? Change this new_cmb2_box() to a default one as a custom post type and tell me if it works
from cmb2-grid.
I will try.
Using as a setting page i need to explicity use cmb2_get_option( 'myprefix', 'id-of-the-field' );
otherwise will not work.
i will try to look if i find a way to modify the code to work with settings page, but it may take a while.
from cmb2-grid.
setting up with 'object_types' => array( 'page')
worked fine.
Thanks anyway, i will try to look under the hood later,maybe i can modify to make it work.
from cmb2-grid.
That's good to know. Thanks
from cmb2-grid.
Related Issues (20)
- Composer autoloading issue since recent update HOT 19
- CSS conflicting with colorpicker component HOT 2
- Box level `show_names` not respected
- Group Field Grid Issue HOT 2
- Some inputs are pre-filled in post-new.php HOT 1
- How to include it inside another plugin? HOT 9
- How to assign columns to repeatable groups HOT 1
- composer installer support HOT 2
- Update composer-installers HOT 1
- The plugin as standalone HOT 4
- Inherit composer.json from CMB2 + packagist HOT 3
- Group field grids causes errors if not before_row and after_row are set
- Groups in a row HOT 1
- This just wont load. HOT 3
- How use it inside CMB2-tabs HOT 1
- CMB2-grid group classes not working HOT 3
- grid row missing default formatting
- Feature Request: Implementing CMB2-grid in a theme
- Support for php 8.0
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cmb2-grid.