bosskmk / pluto_grid

PlutoGrid is a dataGrid for flutter that can be controlled by the keyboard on desktop and web. Of course, it works well on Android and IOS.
https://pluto.weblaze.dev
MIT License
637 stars 291 forks source link

how to control the count for each category #961

Closed rodriger06 closed 7 months ago

rodriger06 commented 8 months ago

Hi Team,

i am having an issue with the number of rows generated for each category for rowgrouping in pluto grid. my code have two category and will have more in the future: income, expenses

columnName.addAll([
      PlutoColumn(
        title: 'Transaction Type',
        field: 'parameters',
        type: PlutoColumnType.select([
          'Income',
          'Expenses'
        ]),
      ),
    ]);

i have some dummy data of length 10. here is my code that specify 10

rowsA.addAll(DummyData.rowsByColumns(length: 10, columns: columnName));

when run my code, it looks that plutogrid randomly split length of 10 rows and distribute to the different category (ex income, expenses) which is not what i am intended to do. check image below

Screenshot_2023-10-16-07-21-09-83_40deb401b9ffe8e1df2f1cc5ba480b12

I would like to control this count because i will be reading from a database and the count for each category is different. in the DummyData class of the demo source code, i can see the following code which control the number of rows pass to the funcion

  static List<PlutoRow> rowsByColumns({
    required int length,
    required List<PlutoColumn> columns}) {

    return List<int>.generate(length, (index) => index).map((_) {
      return rowByColumns(columns);
    }).toList();
  }

my database has one row for income and 9 rows for expenses. how can I change the plutogrid code so that I can make it display 1 row for income and 9 rows for expenses etc etc.? how can i control this count so that it is not randomly splitting the count among the categories?

thanks in advance

github-actions[bot] commented 7 months ago

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

github-actions[bot] commented 7 months ago

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