Coder Social home page Coder Social logo

Comments (9)

aleksei-baryshnikov avatar aleksei-baryshnikov commented on August 27, 2024 1

I mapped, but would be great to have a cb in the colDef.
Mb will do it by myself when have time.

from ka-table.

komarovalexander avatar komarovalexander commented on August 27, 2024

hi @aleksei-baryshnikov you can have [object].[prop] keys (in your example it is 'type.value') in that case grouping will work
example: https://stackblitz.com/edit/table-grouping-ts-mg79sz?file=Demo.tsx

from ka-table.

aleksei-baryshnikov avatar aleksei-baryshnikov commented on August 27, 2024

But in some cases it could be { value: { key: value } }.
In that case should I specify that for each column?
Is it possible to have a function in colDef to build the groupKey?

from ka-table.

komarovalexander avatar komarovalexander commented on August 27, 2024

Can't you just map your data to type.value structure ?

from ka-table.

aleksei-baryshnikov avatar aleksei-baryshnikov commented on August 27, 2024

I can't because in some cases I need to aplly special formatting for the cells. Saying that a cell value couldn't be a string. This is why it would be nice having a property like format.

from ka-table.

aleksei-baryshnikov avatar aleksei-baryshnikov commented on August 27, 2024

For me the problem is that the cell contains some meta information which needs for making some actions when an user clicks on a cell. And ka-table takes it as is, as you can see on the screen. Here is no possibility to define key for cell rendering and key for cell grouping separately.

Screenshot 2024-02-27 at 19 17 50

If I set key: cell.value then I am missing cell.actions in the table config, like FormatFunc.

from ka-table.

komarovalexander avatar komarovalexander commented on August 27, 2024

you can map data and add separate prop for grouping, and by onClick or any other actions you can access original data though rowData, example: https://stackblitz.com/edit/table-grouping-ts-hdf9h3?file=Demo.tsx

from ka-table.

aleksei-baryshnikov avatar aleksei-baryshnikov commented on August 27, 2024

That works but how to be with groups? I want to have the same formatting in there.
But in grouping I don't have rowData if a group is collapsed, so it doesn't give me actions.

from ka-table.

komarovalexander avatar komarovalexander commented on August 27, 2024

There is groupItems in Group, you can access required data using it, demo: https://stackblitz.com/edit/table-grouping-ts-wg5rpj?file=Demo.tsx

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