Jump to:

23006 Posts in 11856 Topics by 2828 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: 130 Views
  • vxd
    Avatar
    Community Member
    16 Posts

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

    Hello,

    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.
    http://api.silverstripe.org/3.0/class-GridFieldAddNewButton.html

    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;

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