Datatables column resize with component select2

Datatables column resize with component select2

Jim3540Jim3540 Posts: 15Questions: 5Answers: 0

Hello everyone,

First I must thank you for an exelect plugin! I think it is very good! I have played around with a problem that I can not solve, so I see if someone have experied the same problem.

Example1

I added filter for each column. When I add an input to filter the column the resize of the columns works.
http://live.datatables.net/qehahefa/1/

Example2

If I replace the input with the component select2 to filter the column the resize of the columns does not work as with the serach input. The scrollbar apperas eariler than with the serach, see picture and example.
http://live.datatables.net/qehahefa/2/

Does anybody know why this happends?

Best Regards
Jim

Answers

  • Jim3540Jim3540 Posts: 15Questions: 5Answers: 0
    edited July 2021

    ..

  • allanallan Posts: 63,494Questions: 1Answers: 10,470 Site admin

    Select2 appears to be applying a fixed width to the input element:

    You'd need to ask in the Select2 support channels or StackOverflow on how to stop it doing that (if it isn't in their docs).

    Allan

  • Jim3540Jim3540 Posts: 15Questions: 5Answers: 0
    edited July 2021

    Thanks Alan, I will do that. I notice also that the example2 got different behaviour on crome and edge. On edge the scrollbar appears earlier than on crome. Is that also a select2 issue?

    Can I override he select2 width in some way? To put it to 100%?

    Cheers Jim

  • kthorngrenkthorngren Posts: 21,324Questions: 26Answers: 4,949

    Can I override he select2 width in some way? To put it to 100%?

    As Allan suggested:

    You'd need to ask in the Select2 support channels or StackOverflow on how to stop it doing that (if it isn't in their docs).

    Here are the select2 docs. Maybe this section of the docs. Or you can try searching or asking on https://stackoverflow.com/.

    Kevin

Sign In or Register to comment.