Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Remove add method in ComplexTableField

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

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

Page: 1
Go to End
Author Topic: 1937 Views
  • Mohan
    Avatar
    Community Member
    19 Posts

    Remove add method in ComplexTableField Link to this post

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

    Cheers!

  • dio5
    Avatar
    Community Member
    501 Posts

    Re: Remove add method in ComplexTableField Link to this post

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

  • Mohan
    Avatar
    Community Member
    19 Posts

    Re: Remove add method in ComplexTableField Link to this post

    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

  • dio5
    Avatar
    Community Member
    501 Posts

    Re: Remove add method in ComplexTableField Link to this post

    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.

    1937 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.