如何在OhrmList symfony 1.4中添加复选框列?

时间:2015-07-01 08:37:49

标签: symfony-1.4

我不明白如何在列表中设置带复选框的列?!

我有类在哪里设置列:

class payHeadListConfigurationFactory extends ohrmListConfigurationFactory {

    protected function init() {

        $headerArray = array();

        $header1 = new ListHeader();

        $header1->populateFromArray(array(
            'name' => 'ID',
            'isSortable' => false,
            'sortField' => null,
            'elementType' => 'label',
            'elementProperty' => array('getter' => 'getId')
        ));

        $headerArray [] = $header1;

        $header2 = new ListHeader();
        $header2->populateFromArray(array(
            'name' => 'Pay Head Name',
            'isSortable' => false,
            'sortField' => null,
            'elementType' => 'link',
            'elementProperty' => array(
                'labelGetter' => 'getName',
                'placeholderGetters' => array('id' => 'getId'),
                'urlPattern' => 'index.php/payroll/viewOnePayHead?hdnEditId={id}')

        ));
        $headerArray [] = $header2;
        $this->headers = $headerArray;
    }

    /**
     *
     * @return string 
     */
    public function getClassName() {
        return 'payHead';
    }
} 

此列表的配置:

$configurationFactory = new payHeadListConfigurationFactory();
ohrmListComponent::setConfigurationFactory($configurationFactory);
ohrmListComponent::setListData($pensionList);

但是,当我看到有复选框的示例时,我看不出有什么区别。 可能有人知道复选框必须设置在哪里吗?

1 个答案:

答案 0 :(得分:0)

OHRMList在orangehrmCorePlugin \ config \ list_component.yml中有配置文件

在此文件中也放置了所有其他配置信息和复选框设置。 例如,

Project:
  pluginName: orangehrmAdminPlugin
  hasSelectableRows: true
  unselectableRowIds: []
  idValueGetter: projectId
  title: ''
  tableWidth: 100%
  hasSummary: false
  summary: []
  buttonsPosition: before-data
  formMethod: post
  formAction: 'admin/deleteProject'
  assets: []
  jsInitMethods: []

在ProjectHeaderFactory类中,您需要返回此设置的名称,如下所示:

public function getClassName() {
    return 'Project';
}