5514 Posts in 1733 Topics by 1219 members
|Go to End|
20 November 2012 at 9:15pm
I have a question!Example:In my table,the status column have boolean style so i want to display it on DataObjectManager as CheckboxField
If status is true,the checkboxfield will check else uncheck
How i display the boolean column as checkboxfield in DataObjectManager or ComplexTableField?
20 November 2012 at 10:48pm
I implemented this in the following way with DataObjectManager.
In your Dataobject $db array
static $db = array ('Status' = 'Boolean');
Then in the getCMSFields method
$statusField = new CheckboxField('Status', 'Current Status');
It's that simple. Once a boolean value is saved in the Database for Status then the checkbox will be either checked or not checked. You may want to put some validation in place if this data is coming from somewhere other than your CMS, an API for example.
|Go to Top|