INWTlab / shinyMatrix

https://inwtlab.github.io/shinyMatrix/
Other
19 stars 6 forks source link

How to add automatic sequential row/column headers for shiny Matrix when it is extendable? #24

Closed lgirola closed 2 years ago

lgirola commented 3 years ago

When setting row and/or column to extend = TRUE in the matrixInput function, how do you generate automatic, sequential row and/or column headers? For example, each added column would be labeled A, B, C, D, etc., or Series A, Series B, Series C, etc., or 1, 2, 3, 4, etc.

In reviewing the package documentation I found a reference: createHeader, updateHeader -- name of javascript function to override default function to create/update table header. The function needs to have the table element and the data object as argument. This may be the path I need (???) to take but I am unable to find working examples.

aneudecker commented 2 years ago

It is currently not build in to automatically generate column headers. You would need R to take the output of the matrix field and update the matrix with updateMatrixInput. This likely causes headaches because of the update loop but it should work