ngx-datatables disable column resizing

radtelbi picture radtelbi · Jul 9, 2018 · Viewed 8.6k times · Source

I am currently using ngx-datatable (with [columnMode]="'force'") I want to prevent users from resizing the column size. is it possible? my current code looks like this :

<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>

Answer

Khamit Mateyev picture Khamit Mateyev · Jul 9, 2018

Try this:

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

link to documentataion