Giter Club home page Giter Club logo

Comments (11)

jrheisler avatar jrheisler commented on July 2, 2024 2

Fantastic, thank you so much! I think you're on to a real desktop/web grid for businesses everywhere!

from pluto_grid.

bosskmk avatar bosskmk commented on July 2, 2024 1

You can create a row that matches the current column information with getNewRow and getNewRows of stateManager.

Change the cell value of the created row to the desired value.

After the change, create a row to be added with insertRows, prependRows, appendRows, etc. of the stateManager.

Please let me know if you need more explanation or examples.

from pluto_grid.

bosskmk avatar bosskmk commented on July 2, 2024

Is it the case of using by providing List to StreamBuilder?

            child: StreamBuilder<List<PlutoRow>>(
              stream: ...,
              builder: (context, snapshot) {
                return PlutoGrid(
                  columns: columns,
                  rows: snapshot.data,
                  onChanged: (PlutoOnChangedEvent event) {
                    message(context, event.toString());
                  },
                  onLoaded: (PlutoOnLoadedEvent event) {
                    stateManager = event.stateManager;
                  },
                );
              }
            ),

It doesn't work, currently passing stream data to the rows property.

Passing stream data to the row property to work would be added in the future.

Not now, but by adding a constructor like PlutoGrid.streamBuilder for example.

Below is an example of general row addition and deletion.

example

...

return PlutoGrid(
  columns: columns,
  rows: rows,
  /// Handle when the cell value changes.
  /// class PlutoOnChangedEvent {
  ///   final int columnIdx;
  ///   final PlutoColumn column;
  ///   final int rowIdx;
  ///   final PlutoRow row;
  ///   final dynamic value;
  ///   final dynamic oldValue;
  /// ...
  onChanged: (PlutoOnChangedEvent event) {
    message(context, event.toString());
  },
  onLoaded: (PlutoOnLoadedEvent event) {
    stateManager = event.stateManager;
  },
);

...

/// Adding row.
stateManager.appendRows([
  PlutoRow(cells: {
    'text': PlutoCell(value: ''),
    'number': PlutoCell(value: 0),
  }),
]);

...

/// Removing current row.
stateManager.removeCurrentRow();

from pluto_grid.

jrheisler avatar jrheisler commented on July 2, 2024

It was exactly as you described, but I didn't realize the stateManger was the route to do this. Thank you!!!

from pluto_grid.

bosskmk avatar bosskmk commented on July 2, 2024

It is not documented yet. It is not enough to develop it alone. I will work hard.

from pluto_grid.

jrheisler avatar jrheisler commented on July 2, 2024

I just ran into your pluto grid the other day. I am a new flutter dev, but have been doing pascal for decades. Your grid is what a business grid should be. I probably can not help code, but I will gladly test, or help with documentation if you like. Great job so far!!!

from pluto_grid.

bosskmk avatar bosskmk commented on July 2, 2024

Yes, anything is good.

I've just created a grid, but I haven't used it except for testing.

That's why problems, methods, documentation, and tests that occur during use are all good.

The Pluto series aims to develop a package for Admin or Cms.

There is also one called PlutoMenuBar.

I plan to keep making these things.

from pluto_grid.

jrheisler avatar jrheisler commented on July 2, 2024

I will go over it this weekend, and see what I can do to help. I see that you have implemented stateManager.appendRows(), if you added a removeRows(), the stream updates would be simple.

You have really done so much with key handling and everything. Bravo!

from pluto_grid.

bosskmk avatar bosskmk commented on July 2, 2024

Thanks, I will finish adding the test code now, and I will work on adding removeRows().

from pluto_grid.

asadamatic avatar asadamatic commented on July 2, 2024

@bosskmk Hi there, just tried this feature of adding new rows, but there is a problem.

I am implementing a feature of copying and pasting rows, and what happens is that the newly added rows have same cell key as the ones copied and any change, even the click of mouse is depicted on the rows that were originally copied.

I have thought of a work around, that is the I get the data from the rows that are copied and create new PlutoRow for the data. Would you also recommend this workaround or is there something better?

from pluto_grid.

asadamatic avatar asadamatic commented on July 2, 2024
  1. Created a method that takes values from a row and creates a desired object(List) using statemanager.currentSelectingRows
  2. Mapped the list of object to PlutoRow
  3. Then appended the plutoGrid using statemanager.appendRows

from pluto_grid.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.