Git Product home page Git Product logo

Comments (9)

NexxLuo avatar NexxLuo commented on August 16, 2024 2

Could you share a complete example ? thanks a lot.
Maybe a complete and useable example in the document will be friendly for user.

from react-base-table.

nihgwu avatar nihgwu commented on August 16, 2024

I’d say BaseTable is not recommended to be used directly, you could implement a easier version on you own table component based on the current api, I’ll share our internal implementation of column groups later

from react-base-table.

nihgwu avatar nihgwu commented on August 16, 2024

BTW, here is our API for that

  /**
   * The groups for the columns
   */
  columnGroups: PropTypes.arrayOf(
    PropTypes.shape({
      key: PropTypes.string.isRequired,
      title: PropTypes.string.isRequired,
      parentKey: PropTypes.string,
    })
  ),

from react-base-table.

nihgwu avatar nihgwu commented on August 16, 2024

I'm working on the new demo system right now #21 , will do after that

from react-base-table.

eokoneyo avatar eokoneyo commented on August 16, 2024

@nihgwu Any chance you might be able to share the demo for column groups? I'd find it really helpful

from react-base-table.

nihgwu avatar nihgwu commented on August 16, 2024

@eokoneyo I didn't check the implementation but looks good #252 (comment)

from react-base-table.

eokoneyo avatar eokoneyo commented on August 16, 2024

I also saw that, I'm just a little apprehensive that react-base-table isn't used as a dependency especially considering the project name.

from react-base-table.

sklinov avatar sklinov commented on August 16, 2024

BTW, here is our API for that

  /**
   * The groups for the columns
   */
  columnGroups: PropTypes.arrayOf(
    PropTypes.shape({
      key: PropTypes.string.isRequired,
      title: PropTypes.string.isRequired,
      parentKey: PropTypes.string,
    })
  ),

@nihgwu I believe this API doesn't exist anymore? I couldn't find it in any relevant place in the codebase.
Also the example in the documentation looks outdated, because now there's not such prop as cells in headerRenderer
What is the type of object headerRenderer expected to return in order to have grouped header? A nested array of React.Nodes?

from react-base-table.

sklinov avatar sklinov commented on August 16, 2024

Ok, I think I've figured it out!
For ones of you (@eokoneyo , @NexxLuo ) who are struggling with docs and can't find a working example here's a Sandbox with 2 options for headerRenderer.
Note that there are 2 of them with different signatures (one in <BaseTable > and one in <Column> components).
The headerHeight prop in <BaseTable> is the one that defines the number of levels in header, so if it's a plain number - then it's a regular header, if it's an array of numbers, then it's a multi header.

https://codesandbox.io/s/react-base-table-multi-header-4xh7d?file=/src/App.tsx

from react-base-table.

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.