Angular DataTables (CLI) click is not working inside the responsive view
Version which i using : angular-cli version
- angular-datatables": "4.1.0"
- angular: 2.3.1
The problem :
- i have added to my datatables rows action buttons "Edit" and "Delete"
- those buttons works well on big screen
- when i reduce the screen or simply display on a small = the responsive hide all over columns ==> OK works well
- but, the hidden columns buttons click is not working
please help me to fix this issue urgently. @l-lin
Unfortunately, it's not possible to bind the angular directive inside the responsive extension. I suggest you do not hide the columns containing the buttons with the column priority.
How we perform actions Like edit record and update or delete ..?Please help i m still stuck
As a hack you can set the function on the document and call it using onclick instead of (click).
in the component's constructor inject the document and set a global function that points to your function on the document
@Component({...})
export class Component implements OnInit
constructor(@Inject(DOCUMENT) public document: Document) {}
ngOnInit() {
(<any>this.document).func_to_call_from_responsive_table = this.my_func;
}
my_func(arg) {
console.log(arg);
}
...
}
in the HTML, use the defined function on the document:
<table datatable ...
...
<td>
<button onclick="document.func_to_call_from_responsive_table(123)">123</button>
</td>
...
</table>