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   845 Views

Avatar
nimeso

Community Member, 17 Posts

20 October 2010 at 8:55pm

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

Community Member, 17 Posts

20 October 2010 at 9:07pm

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

Community Member, 17 Posts

20 October 2010 at 9:10pm

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

Jamie