Jump to:

23550 Posts in 19336 Topics by 2890 members

General Questions

SilverStripe Forums » General Questions » GridFieldConfig::create()->addComponents( Button name

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: 191 Views
  • vxd
    Community Member
    16 Posts

    GridFieldConfig::create()->addComponents( Button name Link to this post


    I have read through the docs but I couldn't find anything.

    I would like to replace the default button name for "GridFieldAddNewButton". At the moment it is "Add Gallery Object".

    How can I replace it to "Add New"

    There is a function SetButtonName but I don't know when to call it.

    Here is the code

    $gridFieldConfig = GridFieldConfig::create()->addComponents(
    new GridFieldToolbarHeader(),
    new GridFieldAddNewButton('toolbar-header-right'),
    new GridFieldSortableHeader(),
    new GridFieldDataColumns(),
    new GridFieldPaginator(10),
    new GridFieldEditButton(),
    new GridFieldDeleteAction(),
    new GridFieldDetailForm()
    //public function __construct($name, $title = null, SS_List $dataList = null, GridFieldConfig $config = null) {
    $gridField = new GridField("GalleryObject", "Images", $this->GalleryObjects(), $gridFieldConfig);

    return $gridField;

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.