Static column in the Raw data table


#1

Hello guys, i need your help with something, i have a Raw data table and i need to keep the first column static to the left and immovable, so users cannot drag and drop that column, can you help me with an example of that case?


#2

Well @ivan95, there are two things that you can use, the first one is the column-pinning feature for pi the column to the left, like this:

.set('columnPinning', [
  { field: 'my_field', position:'left' }  
])

And the second one is the suppress-movable feature, so the column is not movable, like this:

// Block the movement of the column 1
.set('suppressMovable', [
    {field: 'column_1', movable: false}
])

#3

Looks very simple, and actually it worked for me, thank you so much, just the las question, and it, can i do this dynamically?, i mean in real time?


#4

Actually we don’t have a function for that but you can access to the ag-grid instance to use the ag-grid functions using this:

cf.getVisualization('my-chart-id')._visualization.grid.gridOptions