7911 Posts in 1354 Topics by 930 members
DataObjectManager Module
SilverStripe Forums » DataObjectManager Module » Interactive Filter of ManyManyComplexTableField
Discuss the DataObjectManager module, and the related ImageGallery module.
Moderators: martimiz, UncleCheese, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
| Go to End | Next > | |
| Author | Topic: | 783 Views |
-
Interactive Filter of ManyManyComplexTableField

5 September 2011 at 2:19am
Hello,
I have two dataobjects that are related manymany. In my case I have an event that is related to individuals. I am attempting to record which individuals are attending an event. I have created a ManyManyComplexTableField and when it loads it lists all the individuals in my database and allow me to click the checkbox and save them to the related event.
Is there anyway to allow my users to actively filter the results in the ManyManyComplexTableField individual list?
Thank you in advance for any assistance.
-
Re: Interactive Filter of ManyManyComplexTableField

5 September 2011 at 3:15pm
Don't you mean ManyManyDataObjectManager? If not, you're in the wrong place!
---------------
Silverstripe tips, tutorials, screencasts, and more. http://www.leftandmain.com -
Re: Interactive Filter of ManyManyComplexTableField

13 September 2011 at 2:28pm
Very cool. It works rather well.
However, the table render does not look anything like the forum documents on the module. I am rendering it within the datamodel manager. Is there another ss page I should include or is this only made to render within an actual page instead of in the datamodel administrator within the administrator pages?
-
Re: Interactive Filter of ManyManyComplexTableField

14 September 2011 at 5:14am
What do you mean "the forum documents on the module?" What is "datamodel manager?"
--------------------
SilverStripe tips, tutorials, screencasts and more: http://www.leftandmain.com -
Re: Interactive Filter of ManyManyComplexTableField

14 September 2011 at 1:20pm
Sorry. I meant ModelAdmin
http://doc.silverstripe.org/sapphire/en/reference/modeladmin
-
Re: Interactive Filter of ManyManyComplexTableField

15 September 2011 at 12:53pm
My question is what controls the layout of a hasmanydataobject in the model admin when calling it to an addtab field?
Please advise if I need to provide more detail.
-
Re: Interactive Filter of ManyManyComplexTableField

16 September 2011 at 1:20am
Dude, I'm so lost. Nothing you're saying is making sense to me. Sorry.
-
Re: Interactive Filter of ManyManyComplexTableField

16 September 2011 at 4:26am Last edited: 16 September 2011 4:26am
Thanks for your patience as I try to explain this.
Nuts. I was going to attach a screenshot but cant'. I'll paste here. It very closely exactly like what is below. Notice Firstname and Last name are not columns like the example documents for data object manager, they are crammed together in a single column. I am trying to get this to display in a nice columar layout. But it is all squeezed together and does not appear to be using a theme.
_____________________________________________________________
Add An Individual
Displaying 1 to 10 of 49*
First Name
Last Name
deselect all
*
Jeb
Furious Edit Delete
*
Zeb
Allman Edit Delete
*
Patricia
Allman Edit Delete
*
Mike
Allman Edit Delete
*Show
results per page_______________________________________________________________________
Here's the code:
class Family extends DataObject {
...function getCMSFields() {
$fields=parent::getCMSFields();
$fields->renamefield('Name', _t('Family.SURNAME'));
$fields->renamefield('City',_t('Family.CITY'));
$fields->renamefield('StateProvince',_t('Family.STATEPROVINCE'));
$fields->renamefield('Postalcode',_t('Family.POSTALCODE'));$tablefield = new HasManyDataObjectManager(
$this,
'Individuals',
'Individual',
array(
'FirstName' => 'FirstName',
'LastName' => 'LastName'
),'getCMSFields_forPopup');$tablefield->setAddTitle( 'An Individual' );
$fields->addFieldToTab( 'Root.Individuals', $tablefield );
return $fields;
}
...
}
| 783 Views | ||
| Go to Top | Next > |

