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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Customising the CMS /

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

ModelAdmin edit objects problem


Go to End


3 Posts   1591 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