I have a table that gets populated with data after a search. I would like to run a script to hide some of the columns after the table is loaded.
I know of ngAfterViewInit()
but don't want to use that because the script needs to run after the search button has been clicked and data populated, not after the page load
I have the function where the code to hide columns after the data is supposed to be loaded but when I step through in the browser debugger, the function is getting hit before there's actual data displayed in the table which is why it's not working
//not working
this.customerService.getCustomers(query).toPromise().then(data => {
this.customers = data;
this.hideColumns();
});
hideColumns() {
$('.addressOld').hide()
}
Where can I call this function instead?