Jump to:

23478 Posts in 18941 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » Grid-Field Buttons?

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: 181 Views
  • Micro
    Community Member
    1 Post

    Grid-Field Buttons? Link to this post

    I am following the example here about gird-fields. My question is why is there a button on create on each of the columns? How would I get rid of it and have sortable columns instead?


    This is the code from the example page. When displayed each column has a button above it that links to a non-existent page. How do I get rid of the buttons?

    public function AllPages() {
    $gridField = new GridField('pages', 'All pages', SiteTree::get());
    $dataColumns = $gridField->getConfig()->getComponentByType('GridFieldDataColumns');
    'Title' => 'Title',
    'URLSegment'=> 'URL',
    'LastEdited' => 'Changed'
    return new Form($this, "AllPages", new FieldList($gridField), new FieldList());

    Attached Files
  • Willr
    Forum Moderator
    5502 Posts

    Re: Grid-Field Buttons? Link to this post

    You can manipulate the GridField through the GridFieldConfig system. http://doc.silverstripe.org/framework/en/reference/grid-field#configuration has an overview of how it works. To add sortable, you'll need a module like https://github.com/ajshort/silverstripe-gridfieldextensions which adds sortable rows.

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.