在悬停时获取R输出的row.name
我想为R构建一个反应式输入,返回悬停时表行的在悬停时获取R输出的row.name,r,shiny,xtable,R,Shiny,Xtable,我想为R构建一个反应式输入,返回悬停时表行的row.name 在R中,表格由可渲染和通过表格输出进行输出 这应该类似于为plotOutput(分别为click和hover)构建的clickID和hoverID 我对JavaScript或jQuery的理解还不够透彻,无法按照以下说明自行构建: 谢谢大家! 更新: 这是我到目前为止的jQuery: $(document).on('hover', '.table-hover tr', function(){ var el = $(
row.name
在R中,表格由可渲染
和通过表格输出
进行输出
这应该类似于为plotOutput(分别为click和hover)构建的clickID和hoverID
我对JavaScript或jQuery的理解还不够透彻,无法按照以下说明自行构建:
谢谢大家!
更新: 这是我到目前为止的jQuery:
$(document).on('hover', '.table-hover tr', function(){
var el = $(this);
$(this).closest("tr").index();
});
var selectRowBinding = new Shiny.InputBinding();
$.extend(selectRowBinding, {
find: function(scope) {
return $(scope).find(".table-hover");
},
getValue: function(el){
return $(el).closest("tr").index();
},
setValue: function(el, value) {
},
subscribe: function(el, callback) {
$(el).on("change.selectRowBinding", function(e) {
callback();
});
},
unsubscribe: function(el) {
$(el).off(".selectRowBinding");
}
});
Shiny.inputBindings.register(selectRowBinding);
但是input$selectRowBinding
仍返回NULL。
我很确定我没有正确定义绑定
我一直在利用这两种资源:
及
如果有人想试一试,这个问题仍然悬而未决!