Create groups dynamically in the RDT


#1

Hello guys, i’m working in a React app using Chartfactor toolkit and i need to create groups and move fields dynamically after the Raw Data Table creation, there is a way to do that in the Raw Data Table? or should i access to the ag-grid instance and do that?


#2

Hey @dani actually, we add some new features, included a list of Raw data table functions, maybe you can use that functions to interact with the Raw Data Table Dynamically, let me show you an example:

cf.getVisualization('my-rdt').get('joinGroup')('myColumn', 'Target group name');


#3

I see, great!, it’s very useful and easy to use, that solve my problem, Thank you @emoya and just one more question, i saw that there is s a function for moving columns, so there is a way to notify that i’m moving a column?


#4

Sure, just take a look at the Raw Data Table events, you can subscribe to the event rdt:columnMoved like this:

myChart.on('rdt:columnMoved', event => {
    // do something
})

#5

I did use those thing previous week and it work super nice for thanks @emoya