Giter VIP home page Giter VIP logo

Comments (4)

aslagle avatar aslagle commented on July 24, 2024

You can use fn to arbitrarily combine multiple fields in a column.

So you could make a field like this:

{ key: 'invoice', label: 'Invoice', fn: function (value, record) {
    if (record.invoices && record.invoices.customer) {
        return record.invoices.customer;
    } else {
        return record.invoice;
    }
}}

That will use invoices.customer in the column if it exists, and invoice if not. Is that what you're trying to do?

Note you do have to specify a key which is used for the first argument to the function, even if you don't want to use it in the function (that's issue #26).

from reactive-table.

stephentcannon avatar stephentcannon commented on July 24, 2024

More like the ability to leave a column out entirely.

So, the render does this. Might not be possible.

Date Price Customer Invoice Id
Date Price Invoice Id

from reactive-table.

aslagle avatar aslagle commented on July 24, 2024

Sorry, that's not possible right now. It's an interesting idea though.

from reactive-table.

stephentcannon avatar stephentcannon commented on July 24, 2024

I have done it outside of this package by iterating over documents and just outputting html, checking for existence of field before rendering the column and sometimes optionally changing the table header if the document has different fields than the last row.

What gets tricky is colspans so the table doesn't look janky!

The feature fits with the inherent concept of mongo documents not always having the same fields.

I will close this for now.

from reactive-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.