Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Customising the CMS

ModelAdmin edit objects problem


Reply

3 Posts   788 Views

Avatar
nimeso

20 October 2010 at 8:55pm Community Member, 17 Posts

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';

}
?>

Avatar
nimeso

20 October 2010 at 9:07pm Community Member, 17 Posts

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

Avatar
nimeso

20 October 2010 at 9:10pm Community Member, 17 Posts

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

Jamie