Ngx-datatable: Dragging is not working when we use custom column header template - 'ngx-datatable-header-template'

Created on 20 Jun 2017  路  1Comment  路  Source: swimlane/ngx-datatable

[x ] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, post on Stackoverflow or Gitter

Current behavior
When we use custom template for ngx-datatable-column.

Example : Your own implementation & demo :
https://github.com/swimlane/ngx-datatable/blob/master/demo/templates/template-dom.component.ts
&
https://swimlane.github.io/ngx-datatable/#inline

donot permit dragging for columns Name and Gender but only allow for Age ( which doesn't have a custom ng-template within ngx-data-datatable-column.

Expected behavior
Drag and repositioning of columns should work with inline templates as well

Reproduction of the problem
Please refer below links and try dragging columns other than Age.
https://github.com/swimlane/ngx-datatable/blob/master/demo/templates/template-dom.component.ts
&
https://swimlane.github.io/ngx-datatable/#inline

What is the motivation / use case for changing the behavior?
Dragging should work for custom column headers as well

Please tell us about your environment:
VS Code

  • Table version: 0.8.x
    Yes with most recent version

  • Angular version: 2.0.x
    4.0

  • Browser: [all ]

  • Language: [all]

Most helpful comment

Never mind. Figured on my own. column header template should have 'draggable' class like this :
<ng-template let-column="column" let-sort="sortFn" ngx-datatable-header-template> <span class="datatable-header-cell-wrapper"> <span class="datatable-header-cell-label draggable" (click)="sort()">{{column.name}}</span></span> </ng-template>

I would advise you to please improve your documentation to cover these gotchas.

>All comments

Never mind. Figured on my own. column header template should have 'draggable' class like this :
<ng-template let-column="column" let-sort="sortFn" ngx-datatable-header-template> <span class="datatable-header-cell-wrapper"> <span class="datatable-header-cell-label draggable" (click)="sort()">{{column.name}}</span></span> </ng-template>

I would advise you to please improve your documentation to cover these gotchas.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jguttman94 picture jguttman94  路  3Comments

alceucardoso picture alceucardoso  路  3Comments

lautarobock picture lautarobock  路  3Comments

eddy-geek picture eddy-geek  路  3Comments

dinvlad picture dinvlad  路  3Comments