pluto_grid icon indicating copy to clipboard operation
pluto_grid copied to clipboard

Bug when expanding columns

Open hs9574 opened this issue 2 years ago • 7 comments

PMluSiXJce 이런 식으로 초기에 화면 로드했을때는 컬럼끝에 2개의 컬럼이 안나타나고 화면 리사이즈해줄때 나타납니다. 어떤 방법 없을까요??

hs9574 avatar Jul 12 '22 02:07 hs9574

@hs9574 문제를 재현 할 수 있는 최소한의 예제 코드를 제공해 주실 수 있나요?

Can you provide some minimal example code to reproduce the problem?

bosskmk avatar Jul 12 '22 02:07 bosskmk

PlutoGrid 시작시 onLoaded 에서 autoSizeMode 를 scale 로 변경해서 동작 시켜봤을 때 저는 문제가 발생 되지 않았습니다. 어떻게 문제가 발생하는지 예제 코드를 부탁드립니다.

When starting PlutoGrid, I did not have any problems when I changed the autoSizeMode to scale in onLoaded to operate it. Could you please give me an example code of how the problem arises.

child: PlutoGrid(
  columns: columns,
  rows: rows,
  columnGroups: columnGroups,
  // mode: PlutoGridMode.selectWithOneTap,
  onChanged: (PlutoGridOnChangedEvent event) {
    print(event);
  },
  onLoaded: (PlutoGridOnLoadedEvent event) {
    stateManager = event.stateManager;
    stateManager.setColumnSizeConfig(const PlutoGridColumnSizeConfig(
      autoSizeMode: PlutoAutoSizeMode.scale,
    ));
  },

or

child: PlutoGrid(
  columns: columns,
  rows: rows,
  columnGroups: columnGroups,
  // mode: PlutoGridMode.selectWithOneTap,
  onChanged: (PlutoGridOnChangedEvent event) {
    print(event);
  },
  configuration: const PlutoGridConfiguration(
    columnSize: PlutoGridColumnSizeConfig(
      autoSizeMode: PlutoAutoSizeMode.scale,
      resizeMode: PlutoResizeMode.pushAndPull,
      restoreAutoSizeAfterHideColumn: true,
      restoreAutoSizeAfterFrozenColumn: true,
      restoreAutoSizeAfterMoveColumn: true,
      restoreAutoSizeAfterInsertColumn: true,
      restoreAutoSizeAfterRemoveColumn: true,
    ),
  ),

bosskmk avatar Jul 12 '22 02:07 bosskmk

@bosskmk 이게 제 코드인데 컬럼들이 렌더링이 다 될때도 있고 안될때도 있더라구요.. 저는 PlutoGridConfiguration에서 autoSizeMode를 scale해줬어요.

Expanded(
  child: Stack(
    children: [
      PlutoGridWidget(
        columns: columns(),
        rows: rows(),
        onLoaded: (event){
          stateManager = event.stateManager;
        },
        onChanged: (event){
          dynamic value = event.value;
        },
      ),
    ],
  ),
)

PlutoGridWidget

  @override
  Widget build(BuildContext context) {
    return PlutoGrid(
      columns: columns,
      rows: rows,
      configuration: PlutoGridConfiguration(
        style: PlutoGridStyleConfig(
          borderColor: const Color(0xffa4a4a4),
          gridBorderRadius: BorderRadius.circular(10),
          iconSize: 0,
          activatedColor: Colors.white,
        ),
        columnSize: PlutoGridColumnSizeConfig(
          autoSizeMode: PlutoAutoSizeMode.scale,
        ),
        enableMoveHorizontalInEditing: true,
      ),
      onLoaded: onLoaded,
      onChanged: onChanged,
    );
  }

hs9574 avatar Jul 12 '22 04:07 hs9574

@hs9574 첨부하신 예제 코드로는 제가 문제를 재현 할 수 없습니다. 가능하시다면 재현 가능한 예제코드를 부탁드립니다.

그리고 PlutoGrid 에 colums 와 rows 를 최초에 전달 한 이후에 런타임 상태에서 이 리스트들을 변경 하시려면 stateManager.insertColumns, removeColumns, insertRows, prependRows, appendRows, removeRows, removeAllRows 등의 메서드로 해야 합니다.

그렇지 않으면 그리드에 반영되지 않는 경우가 발생 할 수 있습니다.

그리고 현재 컬럼이나 셀이 일부 보이지 않는 경우는 PlutoGrid의 버그 일 것이라고 생각합니다.

문제를 찾아 해결 하기 위해 예제코드를 부탁드립니다.

I can't reproduce the problem with the example code you attached. If possible, please provide reproducible example code.

And if you want to change these lists in the runtime state after first sending columns and rows to PlutoGrid, you must use methods such as stateManager.insertColumns, removeColumns, insertRows, prependRows, appendRows, removeRows, removeAllRows.

Otherwise, it may not be reflected in the grid.

And I think it is a bug of PlutoGrid if some of the current columns or cells are not visible.

Please provide example code to find and solve the problem.

bosskmk avatar Jul 12 '22 07:07 bosskmk

@hs9574 그리고 런타임 중에 columns, rows 를 변경 하는 로직이 있다면 이것을 제외 시키고 순수한 상태로 동작시켜 보십시요. 동일하게 문제가 발생하는지 아닌지에 따라서 어느 부분에 문제가 있는지 좁혀볼 수 있을거 같습니다.

And if there is logic to change columns and rows during runtime, try to operate it in a pure state by excluding it. Depending on whether the same problem occurs or not, you can narrow down the scope of where the problem is.

bosskmk avatar Jul 12 '22 07:07 bosskmk

컬럼을 런타임에 변경 할 때 아래와 같은 메서드로 변경 했을 때 문제가 발생 되지 않았습니다. 시도해보시고 결과를 알려주시면 감사하겠습니다.

When changing a column at runtime, there was no problem when using the method below. I'd appreciate it if you try it and let me know the results.

stateManager.removeAllRows();
stateManager.removeColumns(stateManager.refColumns);
stateManager.insertColumns(0, columns);
stateManager.insertRows(0, rows);

test

bosskmk avatar Jul 12 '22 08:07 bosskmk

@hs9574 아직 해결이 안되셨다면 PlutoGrid 5.0.4 버전으로 시도해 보십시요. 동일한 문제는 아니지만 비슷한 문제가 있어 수정 후 5.0.4 버전으로 배포 하였습니다. 수정 된 문제는 윈도우의 사이즈를 최대로 넓히는 등의 사이즈 변경이 있을 때 일부 컬럼과 셀이 출력되지 않는 것 입니다.

If it is not resolved yet, please try with PlutoGrid 5.0.4 version. It is not the same problem, but there is a similar problem, so after fixing it, it was distributed as version 5.0.4. The fixed problem is that some columns and cells are not displayed when there is a size change such as maximizing the window size.

bosskmk avatar Jul 17 '22 17:07 bosskmk

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] avatar Aug 17 '22 11:08 github-actions[bot]

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] avatar Sep 01 '22 11:09 github-actions[bot]