tabulator
tabulator copied to clipboard
When using a function to set the icon for sorting, it doesn't work
In the documentation there is a section Different icons depending on Sort Direction
with a function. This function changes the icon based on the sort sequence. The given example doesn't seem to work in jsfiddle, see: https://jsfiddle.net/ekoster/Lzofjr2m/4/
Looking into this, it seems that the switch through the options of headerSortElement
does detect it as a function, however it is set to do nothing with the function. This means there is no icon in the defined element arrowEl
. It then goes to the function setColumnHeaderSortIcon
to set the icon. Passed to the function is an empty div
. Due to this, the while loop fails, there is no first child.
Possible solution (I haven't jumped to trying it out yet) is to only do the while loop if the passed div is not empty.