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
664 stars 305 forks source link

[Bug] Anyone can use this package successfully? I even can not refresh the datagrid after feteched data from my backend service. #873

Closed denghejun closed 1 year ago

denghejun commented 1 year ago

Anyone can use this package successfully? I even can not refresh the datagrid after fetched data from my backend service.

denghejun commented 1 year ago
HubService.instance.getOrders({}).then((orders) {
      var rows1 = [
        PlutoRow(
          cells: {
            'order_id': PlutoCell(value: 'e.xxxx'),
            'order_status': PlutoCell(value: 'e.status?.name'),
            'customer_name': PlutoCell(value: 'e.customer?.name'),
            'created_date': PlutoCell(value: '2020-09-09'),
            'created_person': PlutoCell(value: 'e.createUserID'),
            'modify_date': PlutoCell(value: '2020-09-09'),
            'modify_person': PlutoCell(value: 'e.modifyUserID'),
          },
        )
      ];

      PlutoGridStateManager.initializeRows(
        columns,
        rows1,
      );
      stateManager?.setShowLoading(false);
    });
graemep-nz commented 1 year ago

PlutoGrid works for me but it took me ages to find out how to change the content of the grid after the constructor runs. The docs here help https://pluto.weblaze.dev/series/pluto-grid https://pluto.weblaze.dev/add-and-remove-columns-and-rows

so now what I do in the build method is this stateManager?.removeAllRows(notify:false); stateManager?.appendRows(plutoRows);

jesussmile commented 1 year ago

Damn! i too have to remove and append rows else it wont show from backend, any this else to keep in mind ?

github-actions[bot] commented 1 year ago

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

github-actions[bot] commented 1 year ago

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