Datatables column resize with component select2

Datatables column resize with component select2

Jim3540Jim3540 Posts: 8Questions: 3Answers: 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: 8Questions: 3Answers: 0
    edited July 9

    ..

  • allanallan Posts: 54,578Questions: 1Answers: 8,533 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: 8Questions: 3Answers: 0
    edited July 9

    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: 13,625Questions: 25Answers: 3,205

    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.