GithubHelp home page GithubHelp logo

Comments (4)

ngduc avatar ngduc commented on September 21, 2024

@VidaShannon I tried to update columns when prop changed but it became more complicated. (I have to keep it in state for that)

I think this is simpler to use:
this.ref.table.setColumns(newColumns);

from react-tabulator.

cocodrino avatar cocodrino commented on September 21, 2024

Hi @ngduc but i'm a little upset...I've spend some time configuring this table, adapting my ajax response and working for display data, now I need add a new column and I discover that this table is not reactive and don't respond to my table changes.

I think that would be useful for other people include this information in the readme, I don't have so much time for try any other table solution and I'd be open even to re render my table if there is some change in the table config or in the data, do you know how can I rerender my table on changes? I'm using a functional component with my table inside...

also, I need that when I press some button my table change, so the columns after click are differents, I'm afraid that this will be impossible with this lib.

thank you

from react-tabulator.

cocodrino avatar cocodrino commented on September 21, 2024

@ngduc I think that using $("#example-table").tabulator("redraw", true); could works for me, forcing to redraw the entire table if the columns are different (I could comparte the columns with some state) but I don't know how achieve this with react (and avoid jquery)

from react-tabulator.

ngduc avatar ngduc commented on September 21, 2024

@cocodrino assume your table looks like this:

<ReactTabulator
          ref={ref => (this.ref = ref)}
          columns={columns}
          data={[]}
          options={options}
        />

after changing your columns, call:
this.ref.table.setColumns(newColumnArr);
it should tell the table to redraw with the new newColumnArr.

I'll revisit the reactive columns prop idea when I have some bandwidth.

from react-tabulator.

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.