Jump to:

23481 Posts in 18965 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » TableField

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Page: 1
Go to End
Author Topic: 291 Views
  • kindlemanwill
    Community Member
    67 Posts

    TableField Link to this post


    I'm trying to use TableField to manage a list of related links to a page. I have the control working, except it isn't saving the id to the db (a hidden field), just the title and url

    Is this the right way to be using it? think so. I've been using this: http://doc.silverstripe.org/sapphire/en/reference/tablefield as a guide

    some code:

    static $has_many = array (
          'Linketys' => 'Linkety',       

    $myTableField = new TableField(
           'MyTableField', // fieldName
           'Linkety', // sourceType
           ), // fieldList
           ), // fieldTypes
           null, // filterField (legacy)
          // add some HiddenFields thats saved with each new row
           'PageID' => $this->ID ? $this->ID : '$RecordID'
          $fields->addFieldToTab("Root.Content.Options", $myTableField);

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.