primeng
primeng copied to clipboard
Add support of ngAfterViewInit event to p-dataTable
Hey, Is it possibile to add new(?) event which will be called direclty after dataTable is constucted?
My grid is lazy loaded. In load event after filling data I want to style some rows with javascript. But im not able to access grid cuz it isnt initialized yet. I make work-around this by adding timer (very ugly way):
var veryUglyWay2 = setTimeout(() => { if ($('#tbl' + event.DocNo).length > 0) { var tbl = $('#tbl' + event.DocNo); [....] clearTimeout(veryUglyWay2); } }, 20);But now my styling is applied after grid is drawn => so I see 'basic' grid and i.e. 1sec later style is applied. I need to access the grid after it is initialized and before it is drawn.
I guess you can use afterViewInit or afterViewChecked at your own component that uses the datatable.