angular-datatables icon indicating copy to clipboard operation
angular-datatables copied to clipboard

Angular DataTables (CLI) click is not working inside the responsive view

Open KerolosMalak opened this issue 9 years ago • 3 comments

Version which i using : angular-cli version

  1. angular-datatables": "4.1.0"
  2. angular: 2.3.1

The problem :

  1. i have added to my datatables rows action buttons "Edit" and "Delete"
  2. those buttons works well on big screen
  3. when i reduce the screen or simply display on a small = the responsive hide all over columns ==> OK works well
  4. but, the hidden columns buttons click is not working

please help me to fix this issue urgently. @l-lin

KerolosMalak avatar Aug 28 '17 11:08 KerolosMalak

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.

l-lin avatar Sep 03 '17 10:09 l-lin

How we perform actions Like edit record and update or delete ..?Please help i m still stuck

pakcybershagufta avatar Apr 06 '18 09:04 pakcybershagufta

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>

motcke avatar Nov 13 '21 22:11 motcke