Hi, I have a HasManyComplexTableField object, and in the CMS I wanted the admin users to not have to 'check' a new item when they added them.
I knew if I left it like it is by default, I would have to explain to them that they need to check items when they add them in order to make them appear on the front end of the site, so I added the relationAutoSetting = true parameter, and that resolved that issue.
However, when I tested the CMS after adding several items, I unchecked one of them, just to confirm it hid it from the front end of the site, which it does.
But it also hides it from the table view in the CMS, so there's no way for an admin user to check it after they had unchecked it.
Here's the code that I am using:
function getCMSFields() {
$fields = parent::getCMSFields();
$minutes = new HasManyComplexTableField(
$this,
"Minute",
"MinutesEntry",
array(
"MinutesDate" => "Date",
"MinutesGroup" => "Group",
"MinutesName" => "Name",
),
"getCMSFields_forPopup",
"",
"MinutesDate DESC, MinutesGroup ASC"
);
$minutes->setAddTitle('minutes');
// Set how many per page in the object list.
$minutes->setPageSize(18);
$minutes->setPermissions(array('add', 'edit', 'delete'));
$minutes->setFieldCasting(array('MinutesDate' => 'Date->Long'));
// Set the flag to live by default
$minutes->relationAutoSetting = true; // When this is set, it hides the unchecked items from the table?
$fields->addFieldToTab('Root.Content.Minutes', $minutes);
return $fields;
}
If I comment out the "$minutes->relationAutoSetting = true;" part, then in the list of items in the CMS, I can see both the checked and the unchecked items, so that resolves that issue, but obviously reverts my initial problem.
I can just go with the "having to explain that they need to check items for them to appear" option, but I was wondering if there's a solution to both of my issues?
Thanks for any help.