Provide a data and display value separately?

Tags: #<Tag:0x00007f0b003c79d8>

Hi,

Due to how we want to display some data, I wondered if there was a way to provide the data source to HandsOnTable so that it can display one value, and ‘filter’ by another.

So for example, we currently pass data through to HandsOnTable and depending on the length of the text we truncate it. We do this currently using a custom cell renderer, so that the dropdowns in the headers can show the raw data correctly. However, we have to modify the dom each time and scrolling in the tables with this functionality in causes a slowdown in speed - it would be preferable if we were able to provide a ‘display value’ which is the truncated value, and a ‘regular value’ which is what the filter uses to show.

Is this at all possible?

Thanks,

Dan

Good day Dan,

I’m sorry for keeping you waiting. I did not get some notification on the forum.

I wondered if there was a way to provide the data source to HandsOnTable so that it can display one value, and ‘filter’ by another.

The filters API work only for the data that is provided. Here https://jsfiddle.net/60x43Lan/ you can see that I’ve changed the data with a custom renderer but the filters are showing what we have in the source data. So yes, partially you can show something else than the data being filtered. However, you cannot pass a different list of values that the once in the source data.

Af far as I understand you could also manipulate the length of the filters list by CSS.

Can you share a fragment of the data and the desired cut?