has anyone come accross this.
I have used model Admin to display and edit a DataObject but I cannot scroll.
Im using Firefox
code
GlobalAdmin.php
--------------------------------------
class GlobalAdmin extends ModelAdmin {
public static $managed_models = array(
'FooterIcon', 'GlobalBanner', 'FootNote', 'ccswlogin','Office'//'NavStyle'
);
static $url_segment = 'Global'; // will be linked as /admin/products
static $menu_title = 'Global';
}
---------------------------------------
Office.php
<?php
class Office extends DataObject {
static $db = array(
'MainOffice' => 'Boolean',
'CompanyReg' => 'Text',
'VATNo' => 'Text',
'Title' => 'Text',
'Address1' => 'Text',
'Address2' => 'Text',
'Address3' => 'Text',
'Address4' => 'Text',
'City' => 'Text',
'Country' => 'Text',
'Postcode' => 'Text',
'Tel' => 'Varchar',
'Fax' => 'Varchar',
'Email' => 'Varchar',
'OfficeExtra' => 'HTMLText'
);
static $singular_name = 'Office';
static $plural_name = 'Offices';
static $has_one = array(
'SiteTree' => 'SiteTree',
'officepagelink' => 'SiteTree',
);
// Model Admin utilities
static $searchable_fields = array(
'Title',
'Postcode'
//'ID',
//'helpline'
);
static $summary_fields = array(
'MainOffice',
'Title',
'Address1',
'City',
'Postcode',
);
function getCMSFields(){
$source = DataObject::get("SiteTree");
$optionArray = $source->toDropDownMap($index = 'ID', $titleField = 'Title', "--- select page ---", $sort = "Sort");
if($source) foreach( $source as $page ) {
$optionArray[$page->ID] = $page->MenuTitle;
}
$fields = new FieldSet(
//new DropdownField("AllSameASID","Set Links Same As",$optionArray),
new CheckBoxField('MainOffice', "Tick to mark as MainOffice"),
new TextField('CompanyReg', 'Companys House Reg eg: Registered in England 00000','Email'),
new TextField('VATNo', 'VAT No eg:GB 383 8602 20
', 'Email'),
new TextField('Title', 'Office Name'),
new TextField('Address1', 'Address line1'),
new TextField('Address2', 'Address line2'),
new TextField('Address3', 'Address line3'),
new TextField('Address4', 'Address line4'),
new TextField('City', 'City'),
new TextField('Country', 'Country'),
new TextField('Postcode', 'Postcode'),
new TextField('Tel', 'Tel'),
new TextField('Fax', 'Fax'),
new EmailField('Email', 'Email'),
new HtmlEditorField('OfficeExtra', 'ExtraContent'),
new DropdownField("officepagelinkID","Link To Page",$optionArray),
new LiteralField (
$name = "literalfield",$content = "<p>Remember to click Save / Add</p>"
)
);
return $fields;
}
function VarOfficeLink() {
$dos = new DataObjectSet();
$fieldname = "officepagelinkID";
if($this->$fieldname > 0) {
if($page = DataObject::get_by_id("SiteTree", $this->$fieldname - 0)) {
$dos->push($page);
}
}
return $dos;
}
}
?>
This works in the Admin, but I can't scroll down to edit other fields.
Any advice appreciated
picture attached