【发布时间】:2022-09-27 22:51:48
【问题描述】:
reactable 的文档提供了一种使用 custom action 定义的方法onClick.
onClick = JS(\"function(rowInfo, column) {
// Only handle click events on the \'details\' column
if (column.id !== \'details\') {
return
}
// Display an alert dialog with details for the row
window.alert(\'Details for row \' + rowInfo.index + \':\\\\n\' + JSON.stringify(rowInfo.values, null, 2))
// Send the click event to Shiny, which will be available in input$show_details
// Note that the row index starts at 0 in JavaScript, so we add 1
if (window.Shiny) {
Shiny.setInputValue(\'show_details\', { index: rowInfo.index + 1 }, { priority: \'event\' })
}
}\")
reactable 是否连续提供OnDoubleClick 函数?
(source code 显示了一个 utils.R 文件,其中包含一个 OnDoubleClick,但 R 中的可反应对象似乎没有公开这样的功能)。
标签: javascript r reactable