8000 [RFC] Add "config" builders like mapping building in DoctrineBundle · Issue #33 · fsi-open/datagrid-bundle · GitHub
[go: up one dir, main page]

Skip to content
[RFC] Add "config" builders like mapping building in DoctrineBundle #33
@stloyd

Description

@stloyd

It would be really nice to have option to define grid in i.e. Resource/config/datagrid/xxx.yml with something like that:

columns:
    id:
        type: number
        options: 
            label: Identity

    title:
        type: text
        options: 
            editable: true

    author:
        type: text
        options: 
            editable: true
            field_mapping: [author_name, author_surname, author_email]
            value_glue: '<br/>'

    publication:
        type: datetime
        options: 
            field_mapping: [publication_date]
            value_format: 'Y.m.d H:i:s'
            label: Publication date

Would be transfered into calls:

$grid
     ->addColumn('id', 'number', array('label' => 'Identity'))
     ->addColumn('title', 'text', array('label' => 'Title'))
     ->addColumn('author', 'text', array(
        'field_mapping' => array(
            'author_name',
            'author_surname',
            'author_email'
        ),
        'value_glue' => '<br/>',
        'label' => 'Author'
    ))
    ->addColumn('publication', 'datetime', array(
        'field_mapping' => array('publication_date'),
        'value_format' => 'Y.m.d H:i:s',
        'label' => 'Publication date'
    ))
;

What do you think about this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0