5098 Posts in 1518 Topics by 1115 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1454 Views |
-
MemberTableList adding fields (updateSummaryFields)

14 January 2010 at 3:40pm
I am trying to add a dropdown populated by another dataobject (Company) to the MemberTableList (Security Tab)
The DataObjectDecorator:
class Customer extends DataObjectDecorator {
static $summary_fields = array(
'CompanyID' => 'Company'
);
function extraDBFields() {
return array(
'has_one' => array(
'Company' => 'Company'
)
);
}
public function updateCMSFields(FieldSet &$fields) {
$companies = DataObject::get("Company")->toDropdownMap('ID', 'CompanyName');
$fields->push(new DropdownField("CompanyID", "Company", $companies));
}public function updateSummaryFields(&$fields)
{
$companies = DataObject::get("Company")->toDropdownMap('ID', 'CompanyName');
$fields->push(new DropdownField("CompanyID", "Company", $companies));
}
}The Company dropdown is added to to the popup and works fine but I can not get it added to the tablelist what am I doing wrong?
Any help much appreciated!!!
-
Re: MemberTableList adding fields (updateSummaryFields)

15 January 2010 at 12:11pm
If one of the dev's could comment on this would be much appreciated there is no clear example I can find doing this seeing that MemberTableField::addMembershipFields is deprecated an also will not let you change the field types this would be really handy I am willing to write a tutorial on this for the wiki if I can get this working.
-
Re: MemberTableList adding fields (updateSummaryFields)

2 June 2010 at 8:46pm
I've got a number of sites with this issue now, does anyone have any documentation on how to add a field to the MemberTableList now that MemberTableField::addMembershipFields has been deprecated for 2.4?????
-
Re: MemberTableList adding fields (updateSummaryFields)

27 July 2010 at 10:31pm
Did we manage to find out how to do this? Adding fields to the Member Table field that is.
-
Re: MemberTableList adding fields (updateSummaryFields)

11 December 2010 at 11:16pm
You need to use Object::add_extension to extend the Member class and then you use the updateSummaryFields function.
There is a bit more of a detailed explanation here:
http://chillburn.com.au/blog/adding-summary-fields-to-the-membertablelist-using-silverstripe-2-4/
| 1454 Views | ||
|
Page:
1
|
Go to Top |


