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're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

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   2199 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.