objectbox / objectbox-dart

Flutter database for super-fast Dart object persistence
https://docs.objectbox.io/getting-started
Apache License 2.0
927 stars 115 forks source link

how to control the count for each category #566

Closed rodriger06 closed 7 months ago

rodriger06 commented 7 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 count

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

greenrobot-team commented 7 months ago

@rodriger06 I'm not sure how this relates to ObjectBox and how we can help here? This is probably a question for the Pluto grid developers?

rodriger06 commented 7 months ago

My apologies. I posted this on the wrong forum