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?
We've moved the forum!
Please use forum.silverstripe.org for any new questions
(announcement).
The forum archive will stick around, but will be read only.
You can also use our Slack channel
or StackOverflow to ask for help.
Check out our community overview for more options to contribute.
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.