Open pgeza opened 3 years ago
Hi,
you can try rerendering the arrows. Therefor use the updateSortheaders
methods of your TableData
object. Hop this helps.
I'm running in the same problem and the updateSortheaders
doesn't solve this. I found this solution in stackoverflow https://stackoverflow.com/a/60413444/8222852, but unfortunately this don't respect the direction and stays always in 'asc' direction.
With a little bit more of searching and tries, I solve that using the css in the stackoverflow's answer of my previous comment and with the following code after the sort event:
this.tableData.sortParams.forEach((sortParam, index) => this.sort.sortChange.emit({active: sortParam, direction: this.tableData.sortDirs[index]}) );
I think this should be in the onSortEvent
function of the TableData
, but its debatable.
Could please share your code? And maybe also a setup to reproduce the initial issue? Thanks
Since there was no activity on this issue, I will close it now
Hello! I've encountered a similar issue where the sort arrows' opacity is initially set to zero, even when the header is sorted. This occurs inconsistently (though it always happens in slightly different ways).
Steps to reproduce:
I've observed that when the arrow renders correctly, the header's _getArrowViewState()
returns 'active', but when it doesn't, the return value is 'asc'. Emitting a sortChange event in ngAfterViewInit
(as @yanlobianchi suggested) resolves the issue, although it seems to be a workaround.
If any maintainer is interested in reopening this issue, I can provide a (MRE).
As you have reopened the issue, I will try to setup a MRE soon.
If someone else encounter this issue, feel free to aslo upload an MRE. The problem (either on the lib or on my project/s) is quite elusive, I'm working on the MRE from time to time, I hope to find the issue in the next 2-3 weeks.
Hi!
I couldn't achieve that on init the table the arrows are shown for the appropriate directions. Only the numbers are shown. Do you have an example for that?