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

[Bug] First column doesn't freeze when programatically yet reported as it has via manual clicks on header #3

Open
mrgithub opened this issue Jan 24, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@mrgithub
Copy link

When I freeze the first column it is not visually frozen but the menu bar says it is when clicked. State manager says it's not frozen. No frozen columns are bigger than 200. I don't understand why it doesn't work.

First column looks like this:

 List<PlutoColumn> get columns {
    return <PlutoColumn>[
      PlutoColumn(
        title: 'Date',
        field: 'date',
        type: PlutoColumnType.date(format: "dd MMM"),
        readOnly: true,
        backgroundColor: Colors.black,
        enableColumnDrag: false,
        enableRowDrag: false,
        enableSorting: false,
        frozen: PlutoColumnFrozen.start,   // this should freeze it and should be enough
        titleSpan: getTitleSpan('Date'),
      ),

onLoaded looks like this:

onLoaded: (PlutoGridOnLoadedEvent event) {
                event.stateManager.setShowColumnFilter(false);
                event.stateManager.setColumnSizeConfig(
                    PlutoGridColumnSizeConfig(
                        autoSizeMode: PlutoAutoSizeMode.scale));
                event.stateManager.columns[0].frozen = PlutoColumnFrozen.start;   // tried to freeze it again just in case
                print("***frozen " + event.stateManager.showFrozenColumn.toString());  // shows false
              },
@mrgithub mrgithub added the bug Something isn't working label Jan 24, 2024
@RADeveloping
Copy link

I think it's calculating the width of all the starting frozen columns. I'm assuming you have more than one frozen column. To test you can unfreeze your other columns and only have your first column frozen.

 @override
  double get leftFrozenColumnsWidth {
    double width = 0;

    for (final column in refColumns) {
      if (column.frozen.isStart) {
        width += column.width;
      }
    }

    return width;
  }

@doonfrs
Copy link
Owner

doonfrs commented Feb 18, 2024

Width calculation is sensitive, I don't think I will have time for it soon, but if someone creates a PR I will review & locally test it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants