【问题标题】:Event handler for checkbox in dojox.enhancedGrid with IndirectSelection带有 IndirectSelection 的 dojox.enhancedGrid 中复选框的事件处理程序
【发布时间】:2014-05-29 01:34:10
【问题描述】:

我正在使用dojo 1.9 EnhancedGrid 和indirectSelection 并尝试调用一个函数 当按照文档中的建议使用 dojo.connect 选中或取消选中复选框时,但它对我不起作用。

dojo.connect(grid.selection, 'onSelected'|'onDeselected', function(rowIdx){alert("I do come here"); });

我查看了 dojo 文档和许多其他帖子/论坛,它们似乎都建议使用上述方法。这是该论坛dojo.connect in dojox.enhancedGrid plugin IndirectSelection 中的另一篇文章,其中有人试图做类似的事情但没能做到。这个问题没有答案,所以再次发布。

请指教。我被困在这里了。

【问题讨论】:

    标签: javascript events dojo grid


    【解决方案1】:

    以防万一,其他人有类似的问题/问题,这是通过提供网格作为第三个参数和处理程序作为第四个参数来解决的。

        dojo.connect(grid.selection, 'onSelected', grid, function(rowIdx){
            var rowItem = grid.getItem(rowIdx); 
            // your code here
        });
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-01-29
      • 1970-01-01
      • 2014-02-01
      • 2017-08-12
      • 2012-06-25
      • 2017-10-21
      相关资源
      最近更新 更多