primeng icon indicating copy to clipboard operation
primeng copied to clipboard

Add support of ngAfterViewInit event to p-dataTable

Open pserafin opened this issue 10 years ago • 1 comments

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.

pserafin avatar Sep 01 '16 09:09 pserafin

I guess you can use afterViewInit or afterViewChecked at your own component that uses the datatable.

cagataycivici avatar May 29 '17 13:05 cagataycivici