Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement ValueProvider for Table Column #1852

Closed
jreznot opened this issue Feb 4, 2019 · 0 comments
Closed

Implement ValueProvider for Table Column #1852

jreznot opened this issue Feb 4, 2019 · 0 comments
Assignees
Labels
state: fixed Fixed by the developer type: enhancement New feature or request ver: 7.0.1 Fixed in version ver: 7.1.0 Fixed in version
Milestone

Comments

@jreznot
Copy link
Contributor

jreznot commented Feb 4, 2019

Environment

  • Platform version: 7.0.0
  • Client type: Web

Description of the bug or enhancement

Implement lightweight replacement for generated column that can produce simple types: boolean / string / date / int / long / etc

Features:

  • generate checkbox if Boolean type is used
  • format using correct locale settings of logged in user
  • print to Excel by default

Limitations:

  • not sortable for now
  • group by is not supported
  • type should be declared before datasource is set, e.g. from XML

Usage example:

<groupTable id="coloursTable" width="100%"
            dataContainer="coloursDs">
    <actions>
        <action id="create" type="create"/>
        <action id="edit" type="edit"/>
        <action id="remove" type="remove"/>
        <action id="refresh" type="refresh"/>
        <action id="excel" type="excel"/>
    </actions>
    <columns>
        <column id="name"/>
        <column id="description"/>
        <column id="someColumn" caption="Test generated field"/>
        <column id="demoValueColumn" type="boolean" caption="Demo"/>
    </columns>
</groupTable>

Controller:

@Subscribe
private void init(InitEvent event) {
    coloursTable.getColumn("demoValueColumn")
            .setValueProvider(colour -> true);
}

// OR
@Install(to = "coloursTable.demoValueColumn", subject = "valueProvider")
private Boolean generate(Colour colour) {
    return true;
}
@jreznot jreznot added the type: enhancement New feature or request label Feb 4, 2019
@jreznot jreznot added this to the Release 7.0 milestone Feb 4, 2019
@haulmont-git haulmont-git added the ver: 7.1.0 Fixed in version label Feb 4, 2019
@haulmont-git haulmont-git added the ver: 7.0.1 Fixed in version label Feb 4, 2019
@natfirst natfirst added the state: fixed Fixed by the developer label Feb 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state: fixed Fixed by the developer type: enhancement New feature or request ver: 7.0.1 Fixed in version ver: 7.1.0 Fixed in version
Projects
None yet
Development

No branches or pull requests

3 participants