Page 1 of 1

Datatable filter text input length

Posted: 16 Feb 2016, 10:08
by darcome
Hello everyone,

I have a question, is it possible to change the length of the filter text input field of the datatable? Or even better, automatically use a percentage of the column width?

Because if you have a short column it goes behind the limits of the column...

you can see the effect even in the demo page if you narrow the browser window

Thanks in advance

Re: Datatable filter text input length

Posted: 16 Feb 2016, 12:50
by cagatay.civici
Try;

Code: Select all

.ui-datatable .ui-column-filter {
  width: 100%;
  box-sizing: border-box;
}

Re: Datatable filter text input length

Posted: 16 Feb 2016, 13:03
by darcome
Yeah!

It works like a charm!

But shouldn't it be the default behavior?

However, thank you very much!

Re: Datatable filter text input length

Posted: 16 Feb 2016, 16:53
by cagatay.civici
Glad to hear, if we get more feedback, we'll make it default.

Re: Datatable filter text input length

Posted: 17 Feb 2016, 11:08
by darcome
I'll discuss my case :)

Here is a screenshot without the css you gave me:

Image

And here the one with the css:

Image

As you can see if you have small columns like "Ente" and "Tipo", the filters are ugly to see because they go beyond the column width....
In the opposite, it could be ugly too to have a so large filter like in the "Oggetto" column...

A good trade off could be to have the 100% thing plus a "maxwidth" setting so the filter will not grow too much...

However I prefer to have a big filter than a filter beyond the column width

What do you think about it?

Re: Datatable filter text input length

Posted: 18 Feb 2016, 11:39
by cagatay.civici
I've added this to upcoming 4.1.

Re: Datatable filter text input length

Posted: 31 May 2018, 16:46
by jkotak
I believe we need this as default.

Solution worked for me too.

Thanks