Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/64.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在悬停时获取R输出的row.name_R_Shiny_Xtable - Fatal编程技术网

在悬停时获取R输出的row.name

在悬停时获取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 = $(

我想为R构建一个反应式输入,返回悬停时表行的
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。 我很确定我没有正确定义绑定

我一直在利用这两种资源:


如果有人想试一试,这个问题仍然悬而未决!