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

Update PivotTable examples #765

Open
lovtsovaik opened this issue Nov 2, 2020 · 0 comments
Open

Update PivotTable examples #765

lovtsovaik opened this issue Nov 2, 2020 · 0 comments

Comments

@lovtsovaik
Copy link

Environment

Description of the bug or enhancement

§4.1.3 Editable PivotTable
The error in code:

    <chart:aggregations default="COUNT">
        <chart:aggregation caption="Count"/>
        <chart:aggregation mode="SUM_OVER_SUM"/>
    </chart:aggregations>

Should be replaced with

    <chart:aggregations default="COUNT">
        <chart:aggregation mode="COUNT"/>
        <chart:aggregation mode="SUM_OVER_SUM"/>
    </chart:aggregations>

because the mode attribute contains possibly options, and the default attribute should be one of them. Otherwise, the opened table is empty and the default parameter is ignored. This can also be added to the documentation text.

§4.3 Using ShowPivotAction
There is not enough information to understand how to use the action.

It needs to clarify that ShowPivotAction should be imported as
com.haulmont.charts.gui.components.action.list.ShowPivotAction, not as com.haulmont.charts.gui.components.action.ShowPivotAction (old implementation)

Also update and expand the example

ShowPivotAction showPivotAction = new ShowPivotAction(tipsGroupTable);
exportButton.setAction(showPivotAction);

to

@Subscribe
public void onInit(InitEvent event) {
    ShowPivotAction showPivotAction = actions.create(ShowPivotAction.class);
    showPivotAction.setTarget(tipsTable);
    defaultShowPivotBtn.setAction(showPivotAction);
}

It would be helpful to clarify how to get the components that extend ListComponent.

@Inject
private GroupTable<TipInfo> tipsTable;

Add the good example link https://demo10.cuba-platform.com/sampler/#main/3/sample?id=pivot-table-show-pivot-action

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant