Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

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.

Data Model Questions /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Use more than one complextablefields


Go to End


981 Views

Avatar
dataforlife

Community Member, 10 Posts

20 October 2011 at 11:08am

Edited: 20/10/2011 11:11am

Hallo,

i want to use two or three complexttablefields of one Class with different filters. How can i do this?

my code is:

$Member_unchecked = new ComplexTableField(
			$this,
			'Member',
			'Member',
			null,
			null,
			"Member.EventsID = {$this->ID} AND checked = '0' "
		
		);	
		
		$fields->addFieldToTab('Root.Content.Not checked Members', $Member_unchecked);	
		
		
		
		
$Member_checked= new ComplexTableField(
			$this,
			'Member',
			'Member',
			null,
			null,
			"Member.EventsID = {$this->ID} AND checked= '1'"
		
		);	
		
		$fields->addFieldToTab('Root.Content.Checked Member', $Member_checked);	
		

But it doesn't work. One of the two tabs is just white. What is wrong?
Is there perhaps an other way to do what i mean?

thanks