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.

Archive /

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

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

Remove add method in ComplexTableField


Go to End


4 Posts   2251 Views

Avatar
Mohan

Community Member, 19 Posts

20 May 2008 at 11:10pm

Hi,
can anyone guide me on how to remove the add method in ComplexTableField?

Cheers!

Avatar
dio5

Community Member, 501 Posts

21 May 2008 at 12:03am

$yourTable->setPermissions(array('delete', 'edit'));

although I'm not 100% sure this works on a complextablefield as well, but it's inherited so it should.

Avatar
Mohan

Community Member, 19 Posts

21 May 2008 at 12:17am

Thanks very much dio5!
It worked like a charm.
I got one more question, is there a way to have a search functionality
in ComplexTableFiled?
Again, thanks a lot and appreciate for your quick reply.

Thanks!
Mohan

Avatar
dio5

Community Member, 501 Posts

21 May 2008 at 12:20am

Well, yes you can, but you'll need to subclass ComplexTableField and add it to it.
Not the easiest, but not undoable either.

Have a look at cms/code/MemberTableField.php for an example of this.