コード例 #1
0
 /**
  * Place the export button in a <p> tag below the field
  *
  * @param GridField $gridField
  * @return array
  */
 public function getHTMLFragments($gridField)
 {
     $button = new GridField_FormAction($gridField, 'export', _t('TableListField.CSVEXPORT', 'Export to CSV'), 'export', null);
     $button->setAttribute('data-icon', 'download-csv');
     $button->addExtraClass('no-ajax font-icon-down-circled action_export');
     $button->setForm($gridField->getForm());
     return array($this->targetFragment => '<p class="grid-csv-button">' . $button->Field() . '</p>');
 }
コード例 #2
0
 /**
  * Place the print button in a <p> tag below the field
  *
  * @param GridField
  *
  * @return array
  */
 public function getHTMLFragments($gridField)
 {
     $button = new GridField_FormAction($gridField, 'print', _t('TableListField.Print', 'Print'), 'print', null);
     $button->setAttribute('data-icon', 'grid_print');
     $button->addExtraClass('gridfield-button-print');
     $button->addExtraClass('font-icon-print');
     return array($this->targetFragment => '<p class="grid-print-button">' . $button->Field() . '</p>');
 }