Jump to:

5540 Posts in 1738 Topics by 1224 members

Customising the CMS

SilverStripe Forums » Customising the CMS » How to add search filter in ComplexTableFields

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

Page: 1
Go to End
Author Topic: 1260 Views
  • ss_freebie
    Community Member
    6 Posts

    How to add search filter in ComplexTableFields Link to this post

    Hi there,
    I have added a dataobject in complextablefields to the cms but there are 300 rows in data. So I would like to add a simple search filter like in the image upload section to filter the results by names or something else.
    I have read the doc in
    about this issue where mentions the followings:

    $fields = singleton('MyDataObject')->searchableFields();
    class MyDataObject extends DataObject {
    static $searchable_fields = array(

    Here is my getCMSFields() function {

    $fields = parent::getCMSFields();

    $tablefield = new ComplexTableField(
        'Name' => "Name",   
        'PostCode' => 'PostCode',
           'Email' => "Email"
        $tablefield->setAddTitle('an Adviser');   
        $fields->addFieldToTab( 'Root.Content.Adviser', $tablefield );      
        return $fields;


    But I am not sure how I should put those lines into my page and dataobject to make it work, I did give it a go but no luck so far. Can any one here point me the direction ? Many thanks in advance.

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.