Adding custom buttons to Datatable DOM #1615
sforsandeep
started this conversation in
General
Replies: 2 comments
-
Hi, Could you try setting If it doesn't work, please provide a reproducible StackBlitz/GitHub link to investigate this. |
Beta Was this translation helpful? Give feedback.
0 replies
-
@shanmukhateja I tried static false already. Fortunately I was able to resolve it using draw.dt event. So I have created a rerender() function and in it I did
So this rerender() function being called when the data is initialised |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am really fedup with a requirement of adding custom element to DOM. I did it many times when using Jquery datatable, but the same approach not working in Angular Datatable which is said to have all the features of jquery datatable.
I have a datatable with below initialisation
Here as you can see I have specified a new DIV in the DOM has got a class btnTooolbar.
I need to add two buttons into that DIV. After some hours of headache I found something to use renderer2
So I have created
@ViewChild('.btnToolbar', { static: true }) d1!: ElementRef;
But it doesnt helped me in anyway.
It triggered an error
Cannot read properties of undefined (reading 'nativeElement')
Someone please help me.
Beta Was this translation helpful? Give feedback.
All reactions