public function getHTMLFragments($gridField)
    {
        Requirements::javascript(MOCK_DATAOBJECTS_DIR.'/javascript/mock_dataobjects.js');
        Requirements::css(MOCK_DATAOBJECTS_DIR.'/css/mock_dataobjects.css');

        $forTemplate = new ArrayData(array());
        $forTemplate->Colspan = count($gridField->getColumns());
        $forTemplate->CountField = TextField::create('mockdata[Count]', '', '10')
            ->setAttribute('maxlength', 2)
            ->setAttribute('size', 2);
        $forTemplate->RelationsField = new CheckboxField('mockdata[IncludeRelations]', '', false);
        $forTemplate->DownloadsField = new CheckboxField('mockdata[DownloadImages]', '', false);
        $forTemplate->Cancel = GridField_FormAction::create($gridField, 'cancel', _t('MockData.CANCEL', 'Cancel'), 'cancel', null)
                    ->setAttribute('id', 'action_mockdata_cancel' . $gridField->getModelClass())
                    ->addExtraClass('mock-data-generator-btn cancel');

        $forTemplate->Action = GridField_FormAction::create($gridField, 'mockdata', _t('MockData.CREATE', 'Create'), 'mockdata', null)
                    ->addExtraClass('mock-data-generator-btn create ss-ui-action-constructive')
                    ->setAttribute('id', 'action_mockdata_' . $gridField->getModelClass());

        return array(
            'before' => $forTemplate->renderWith('MockDataGenerator')
        );
    }
public function getHTMLFragments($gridField)
    {
        Requirements::javascript(MOCK_DATAOBJECTS_DIR.'/javascript/mock_dataobjects.js');
        Requirements::css(MOCK_DATAOBJECTS_DIR.'/css/mock_dataobjects.css');

        $forTemplate = new ArrayData(array());
        $forTemplate->Colspan = count($gridField->getColumns());
        $forTemplate->CountField = TextField::create('mockdata[Count]', '', '10')
            ->setAttribute('maxlength', 2)
            ->setAttribute('size', 2);
        $forTemplate->RelationsField = new CheckboxField('mockdata[IncludeRelations]', '', false);
        $forTemplate->DownloadsField = new CheckboxField('mockdata[DownloadImages]', '', false);
        $forTemplate->Cancel = GridField_FormAction::create($gridField, 'cancel', _t('MockData.CANCEL', 'Cancel'), 'cancel', null)
                    ->setAttribute('id', 'action_mockdata_cancel' . $gridField->getModelClass())
                    ->addExtraClass('mock-data-generator-btn cancel');

        $forTemplate->Action = GridField_FormAction::create($gridField, 'mockdata', _t('MockData.CREATE', 'Create'), 'mockdata', null)
                    ->addExtraClass('mock-data-generator-btn create ss-ui-action-constructive')
                    ->setAttribute('id', 'action_mockdata_' . $gridField->getModelClass());

        return array(
            'before' => $forTemplate->renderWith('MockDataGenerator')
        );
    }
public function getHTMLFragments ( $ gridField ) { Requirements :: javascript ( MOCK_DATAOBJECTS_DIR . '/javascript/mock_dataobjects.js' ) ; Requirements :: css ( MOCK_DATAOBJECTS_DIR . '/css/mock_dataobjects.css' ) ; $ forTemplate = new ArrayData ( array ( ) ) ; $ forTemplate -> Colspan = count ( $ gridField -> getColumns ( ) ) ; $ forTemplate -> CountField = TextField :: create ( 'mockdata[Count]' , '' , '10' ) -> setAttribute ( 'maxlength' , 2 ) -> setAttribute ( 'size' , 2 ) ; $ forTemplate -> RelationsField = new CheckboxField ( 'mockdata[IncludeRelations]' , '' , false ) ; $ forTemplate -> DownloadsField = new CheckboxField ( 'mockdata[DownloadImages]' , '' , false ) ; $ forTemplate -> Cancel = GridField_FormAction :: create ( $ gridField , 'cancel' , _t ( 'MockData.CANCEL' , 'Cancel' ) , 'cancel' , null ) -> setAttribute ( 'id' , 'action_mockdata_cancel' . $ gridField -> getModelClass ( ) ) -> addExtraClass ( 'mock-data-generator-btn cancel' ) ; $ forTemplate -> Action = GridField_FormAction :: create ( $ gridField , 'mockdata' , _t ( 'MockData.CREATE' , 'Create' ) , 'mockdata' , null ) -> addExtraClass ( 'mock-data-generator-btn create ss-ui-action-constructive' ) -> setAttribute ( 'id' , 'action_mockdata_' . $ gridField -> getModelClass ( ) ) ; return array ( 'before' => $ forTemplate -> renderWith ( 'MockDataGenerator' ) ) ; }
Adds the HTML to the GridField that includes options for the mock data as well as the action button

@param GridField
@return array
Adds the HTML to the GridField that includes options for the mock data as well as the action button