Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/33.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
DevXpress网格,仅在Angular 2中选中“行”复选框?_Angular_Devexpress - Fatal编程技术网

DevXpress网格,仅在Angular 2中选中“行”复选框?

DevXpress网格,仅在Angular 2中选中“行”复选框?,angular,devexpress,Angular,Devexpress,我在使用devexpress选择行时遇到问题。我得到了一行,应该只在复选框上被标记,现在它在单击行时被选中。我不得不添加onRowClick,因为我必须打开详细信息,而且交互很奇怪。我打开带有详细信息的弹出窗口,但该行被选中 正常的devex行为是在单击时检查行,是否有方法禁用它并仅在复选框上启用它?我知道它是有效的,但我不知道如何:/ 代码: <dx-data-grid id="gridContainer" (onRowClick)="showDetails($eve

我在使用devexpress选择行时遇到问题。我得到了一行,应该只在复选框上被标记,现在它在单击行时被选中。我不得不添加onRowClick,因为我必须打开详细信息,而且交互很奇怪。我打开带有详细信息的弹出窗口,但该行被选中

正常的devex行为是在单击时检查行,是否有方法禁用它并仅在复选框上启用它?我知道它是有效的,但我不知道如何:/

代码:

    <dx-data-grid
      id="gridContainer" (onRowClick)="showDetails($event)">
    </dx-data-grid>

我从您的问题中了解到的是,您不希望在单击记录后选中复选框。您只希望在选中记录的特定复选框后选中/选择该记录

如果我没记错的话,dx数据网格有一个[showCheckBoxesMode]属性,您可以在用户选中复选框而不是单击记录后传递always值以选择记录

比如说,

在component.html中

 <dx-data-grid
   id="gridContainer" (onRowClick)="showDetails($event)">

  <dxo-selection
     [showCheckBoxesMode]="checkBoxesMode"
     mode="multiple">
  </dxo-selection>

 </dx-data-grid>
要了解有关选择模式的更多信息,请

希望有帮助:

 export class AppComponent {
 //Your rest declarations goes here

 checkBoxesMode: string;
 constructor(service: Service) {
     //Your rest code goes here
     this.checkBoxesMode = 'always'
  }
 }