Toggle hide/show child rows in datatable (without shiny)

和自甴很熟 提交于 2021-01-29 10:15:53

问题


I want to create a datatable from this dataframe:

df1 <- data.frame(
  brand = c("Brand 1", "Subbrand 1.1", "Subbrand 1.2", "Brand 2", "Subbrand 2.1", "Subbrand 2.2"),
  sales = 100 * 1:6
)

The brands should be parent rows and the subbrands child rows which should be hidden in the beginning. On click on a parent rows its subbrands should be shown. This must work without shiny as I want to integrate it into a HTML-flexdashboard.

I think to solve this I will need a callback like in this example but with the child rows fully integrated into the table.

Any help appreciated.

来源:https://stackoverflow.com/questions/64935253/toggle-hide-show-child-rows-in-datatable-without-shiny

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!