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.

Archive /

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

Auto-associate/Auto-check on HasManyComplexTableField


Reply


5 Posts   7713 Views

Avatar
dashiel

Community Member, 13 Posts

4 May 2008 at 11:43am

is there anyway to automatically have the checkboxes default to checked when creating a new entry in a HasManyComplexTableField?

i'm currently filtering the results in the CMS with the $sourceFilter param, which works well, but unfortunately now if i create a new entry it doesn't even give me the option of checking it. so all new entries are hidden unless i manually edit the ID association in mysql.

Avatar
Double-A-Ron

Community Member, 604 Posts

15 June 2008 at 5:02pm

Looking for the exact same thing...

Avatar
Double-A-Ron

Community Member, 604 Posts

15 June 2008 at 5:09pm

Found the solution to this here:http://silverstripe.com/site-builders-forum/flat/45030

$tablefield->relationAutoSetting = true; after the Complex field declaration fixes the issue.

Avatar
cinek

Community Member, 17 Posts

15 June 2008 at 5:55pm

Edited: 15/06/2008 5:56pm

Maybe what you need is ComplexTableField? It displays only items associated with your page, i.e. there are no checkboxes (there is a 'delete' button) and items are automatiacally added to relationship when created.

Avatar
Double-A-Ron

Community Member, 604 Posts

16 June 2008 at 1:45pm

Good tip Cinek. That worked well.