Jump to:

5514 Posts in 1733 Topics by 1219 members

Customising the CMS

SilverStripe Forums » Customising the CMS » ModelAdmin edit objects problem

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

Page: 1
Go to End
Author Topic: 772 Views
  • nimeso
    Avatar
    Community Member
    17 Posts

    ModelAdmin edit objects problem Link to this post

    Hi, firstly thanks for all the hard work! hope I'm not going crazy here?

    I'm trying to create a TeamAdmin Class to extended ModelAdmin.
    Everything is great BUT... I don't have a edit icon and they don't have a pop-up? When I click on the title I do go to a new page saying 'Loaded 'My New Team' for editing' but it has no save button and if I hit enter it dies?

    SS 2.4.1

    <?php
    class Team extends DataObject {
       
       static $db = array (
          'Title' => 'Varchar(255)',
       );
       
       static $searchable_fields = array(
          'Title'
       );
       
       static $summary_fields = array(
           'Title'
       );
       
    }
    ?>

    <?php
    class TeamAdmin extends ModelAdmin {

       public static $managed_models = array(
          'Team'
       );

       public static $allowed_actions = array(
          'add',
          'edit',
          'delete'
       );

       function getEditForm(){
          return $this->bindModelController('Team')->ResultsForm(array());
       }

       static $url_segment = 'teams';
       static $menu_title = 'Teams';

    }
    ?>

  • nimeso
    Avatar
    Community Member
    17 Posts

    Re: ModelAdmin edit objects problem Link to this post

    Works if its a page object??

    <?php
    class Team extends DataObject {

    TO>>

    <?php
    class Team extends Page {

    Is this correct? really just want to use a DataObject but happy to use a page if I have to?

    Cheers
    Jamie

  • nimeso
    Avatar
    Community Member
    17 Posts

    Re: ModelAdmin edit objects problem Link to this post

    Sorry... It works better... eg I have publish buttons that work etc etc but still no 'edit' icon in complex table?

    Jamie

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