angular - ngx-datatables 禁用列大小调整

标签 angular ngx-datatable

我目前正在使用 ngx-datatable (with [columnMode]="'force'") 我想阻止用户调整列大小。可能吗?我当前的代码如下所示:

<ngx-datatable *ngIf="viewType==='client-stats'"
             class='bootstrap fixed-header clients-infos'
             [rows]='rows'
             [columnMode]="'force'"
             [headerHeight]="34"
             [footerHeight]="60"
             [rowHeight]="60"
             [selectionType]="'multiClick'"
             [selected]="selectedRows"
             (select)='onSelect($event)'
             [limit]="10"
             >
  <ngx-datatable-column name="lastname">
     <ng-template let-value="value" ngx-datatable-cell-template>
       {{value |titlecase}}
     </ng-template>
  </ngx-datatable-column>
  <ngx-datatable-column name="Firstname">
    <ng-template let-value="value" ngx-datatable-cell-template>
      {{value |titlecase}}
    </ng-template>
    </ngx-datatable-column>
    ...
</ngx-datatable>
</section>

最佳答案

试试这个:

<ngx-datatable-column [resizeable]="false" name="lastname">

link to documentataion

关于angular - ngx-datatables 禁用列大小调整,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51242493/

相关文章:

gruntjs - 子目录中的Angular2.0,SystemJS无法导入 Angular 组件

javascript - 需要根据行索引隐藏 ngx-datatable 的行

javascript - 在每一行内添加链接 - ngx-datatable

javascript - Angular ngx-datatable 行详细问题

html - 从 ngx-datatable header 中删除多余的空白空间

angular - 收到特定 http 状态后重试 http 调用

javascript - 如何用 Protractor 选择组件元素?

javascript - 无法为自定义 Angular 组件捕获 nativeElement

angular - 按升序和降序对 ngx-datatable 中的数字列进行排序。 Angular 2/4

Angular: [disabled] ="isDisabled()"是正确的方法吗?