Searchpane + Ellipsis Render Plugin

Searchpane + Ellipsis Render Plugin

pybcgpybcg Posts: 41Questions: 10Answers: 0

Link to test case:
Debugger code (debug.datatables.net):
Error messages shown:
Description of problem: When I combine the searchpane and the ellipsis render plugin, I get the following:

What I realize is that the ellipsis render is returning a span element that contains the ellipsis into the searchpane in two places within the searchpane: in the title and within the span itself (classname dtsp-name).

Is there a way I can use the ellipsis ONLY on the datatable but NOT in the searchpane?

Replies

  • sandysandy Posts: 913Questions: 0Answers: 236

    Hi @pybcg ,

    We've actually made some improvements in this area that are available from the nightly builds. This includes removing the searchPanes.dataLength config option so that SearchPanes can just do it automatically. I'd try switching to the nightly build and see if that helps.

    If the problem persists though, we will need to see a test case to provide further help. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Thanks,
    Sandy

  • pybcgpybcg Posts: 41Questions: 10Answers: 0
    edited August 2020

    http://live.datatables.net/henifuku/3/edit

    This shows exactly what my error is! Look at the "Office" column and see that while trying to use the ellipsis plugin to render the field to 5 characters, it also makes the searchpane look weird because the span element that the render is trying to return is making its way to both the title property and the text.

    it'd be nice if there was a way to show ellipsis on the datatable but presented differently on the searchpane.

    Let me know if you have any questions.

  • sandysandy Posts: 913Questions: 0Answers: 236

    Hi @pybcg ,

    Thanks for the test case, something isn't right there. I've raised an issue internally (DD-1633 for my reference) and will report back here when there is an update.

    Thanks,
    Sandy

  • pybcgpybcg Posts: 41Questions: 10Answers: 0

    @sandy thanks for looking into this. would you be against providing the urgency level and timeframe on when this will be completed?

    this bug is pretty significant and we want to understand how long it will take to fix!

  • sandysandy Posts: 913Questions: 0Answers: 236

    Hi @pybcg ,

    We are aiming for a SearchPanes release fairly soon so it is fairly high priority. I'll take a look on Monday and hopefully get it fixed then, assuming I don't run into anything major!

    Thanks,
    Sandy

  • sandysandy Posts: 913Questions: 0Answers: 236

    Hi @pybcg ,

    That should be the issue fixed now as you can see at this example. This will be available in the next SearchPanes release which we hope will be in the next few weeks. Until then you can access the fix from the nightly builds.

    Thanks,
    Sandy

  • pybcgpybcg Posts: 41Questions: 10Answers: 0

    @sandy I saw the fix on the code and I had a question about it. I noticed there's a checker that checks if there's a renderer called "ellipsis" AND if "&#8230" exists.

    1. Is this the long term solution? I would think you'd run into this issue if you ever have instances when you're rendering HTML for any column. Shouldn't searchpanes just search for the underlying data vs what's being rendered?

    2. What happens if a developer makes a custom render function that isn't called ellipsis or uses different symbols other than &#8230?

  • sandysandy Posts: 913Questions: 0Answers: 236

    Hi @pybcg ,

    Thanks for pointing that out. We agree that there are too many cases where this may cause a problem so I have removed that change. We found an alternative solution using behaviour that is already present in SearchPanes though. You can use the columns.searchPanes.orthogonal option to select what data SearchPanes is going to use.

    By setting this property as follows...

    searchPanes:{
        orthognonal:{
            display: 'filter'
        }
    }
    

    SearchPanes will use the filter value rather than what is displayed in the parent DataTable. Take a look at this example. As before, you can access the latest version from the nightly builds.

    Thanks,
    Sandy

This discussion has been closed.