Finally had some time to finish up some of the more pressing matters, which allowed me to start working on CMB again!
The custom fields have been programmed in and they allow for great customizability! It’s almost a shame that this 3pc is gonna be so small.
The following screenshot shows a custom grid with the custom fields provided by the database row itself. Now, since it is a grid, it takes on every field and merges it into a stack. The biggest disadvantage is, that if your one record has 3 custom fields and the other has 10, the grid will show 10. Now, I am going to build in some more configuration for you to disable showing (hiding as it were) the fields you don’t want showing up in your grid.
And as you can see, the database model for MODx looks a bit different.
<?xml version="1.0" encoding="UTF-8"?>
<model package="callmeback" baseClass="xPDOObject" platform="mysql" defaultEngine="MyISAM">
<object class="cmbEntries" table="callmeback_entries" extends="xPDOSimpleObject">
<field key="name" dbtype="varchar" precision="255" phptype="string" null="false" />
<field key="fields" dbtype="text" phptype="json" null="false" />
<field key="parameters" dbtype="text" phptype="json" null="false" />
<field key="updated" dbtype="int" precision="10" phptype="int" null="false" default="0" />
<field key="created" dbtype="int" precision="10" phptype="int" null="false" default="0" />
<field key="state" dbtype="tinyint" precision="1" phptype="int" null="false" default="0" />
</object>
</model>
I hope you guys like it!