【问题标题】:Differentiating the checkbox selection & row selection in dxDataGrid区分 dxDataGrid 中的复选框选择和行选择
【发布时间】:2015-09-16 07:00:37
【问题描述】:

我使用以下选项实现了 dxData 网格。 选择:{ 模式:'多个' } 并且对 onRowClick 和 onSelectionChanged 也有不同的功能。

当 onRowClick 事件被触发时,它也会触发 onSelectionChanged 事件。

谁能建议如何区分这两个事件? 我的意思是当行点击事件被触发时,它不应该提交 onSelectionChanged 事件。选择复选框时应触发 onSelectionChanged 事件。

谢谢

【问题讨论】:

    标签: devextreme


    【解决方案1】:

    这是dxDataGrid 小部件的预期行为。

    要实现您的场景,您可以手动添加带有复选框的列:

    { 
         name: 'Selected',
         cellTemplate: function($cell, cellInfo) {
             var $checkBox = $("<div>").dxCheckBox({
                 onValueChanged: function(args) {
                     // put selection changed handler here....
                 }
                }).appendTo($cell);
            }
    }
    

    我在这里创建了一个小样本 - http://jsfiddle.net/v2fswrvr/

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-07-26
    • 1970-01-01
    • 2018-03-25
    • 1970-01-01
    • 2012-06-27
    • 2022-06-29
    相关资源
    最近更新 更多