Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Column filter going on second row #554

Closed
morfeibox opened this issue Sep 3, 2018 · 15 comments · Fixed by #900 or #960
Closed

Column filter going on second row #554

morfeibox opened this issue Sep 3, 2018 · 15 comments · Fixed by #900 or #960

Comments

@morfeibox
Copy link

morfeibox commented Sep 3, 2018

If Grid column content is shorter than column name, filter icon go on the next row
screen shot 2018-09-03 at 14 28 04 1

@morfeibox morfeibox changed the title Column filter going on secon row Column filter going on second row Sep 3, 2018
@DarkSide666
Copy link
Member

DarkSide666 commented Sep 3, 2018

Related #514

@ibelar
Copy link
Contributor

ibelar commented Sep 4, 2018

You can tweak the icon placement by changing the css class: atk-table-dropdown

By default it is meant to float right, which will cause icon to go on next row if not enough room.

// table dropdown menu
.atk-table-dropdown {
  display: inline;
  float: right;
}

@morfeibox
Copy link
Author

Hi ibelar, I take a look and didn't find how and where I can add my custom css or even how can I change this css class?

@romaninsh
Copy link
Member

i think it should display properly by default. We don't have many CSS developers, i'll assign to @mayack, but he's busy working on other things.

@romaninsh romaninsh assigned mayack and unassigned ibelar Sep 5, 2018
@ibelar
Copy link
Contributor

ibelar commented Sep 5, 2018

In order to override the style, you would normally create your own css file and include the new css file in your app using App::requireCSS method.

$app->requireCSS('path/to/your/css/file');

Just redefine the rule for "atk-table.dropdown" in this new css file.

Hope this help.

@acicovic
Copy link
Collaborator

Hi, a solution has been given to this problem and I don't know if it still occurs. #514 is already closed. I suggest we close this issue.

@DarkSide666
Copy link
Member

Not sure about closing this. Filter (or sorting) icons should never go on next line in my opinion.
That should be default and only one option how it should work.

@ibelar ibelar removed their assignment Oct 26, 2019
@ibelar
Copy link
Contributor

ibelar commented Oct 26, 2019

This is a css issue. The css class name .atk-table-dropdown can be modify to fit everyone needs.
We should close this one.

@mvorisek
Copy link
Member

mvorisek commented Feb 15, 2020

Not fixed, example from demos/tablefilter.php:
image

Real estate is very expensive in comples UIs and for UX it is overall better to have (prererably always) the filter icons on the right side of the column headers.

@mvorisek mvorisek reopened this Feb 15, 2020
@ibelar
Copy link
Contributor

ibelar commented Feb 15, 2020

Having it under the column name is the intended behavior now.
If you need to have it on the same line, you can change/update the .atk-table-dropdown css class.
Using float right and changing top-margin value should give you what you need.

You might also need to update .atk-table-column-header to float:left if you use column sorting.
Screen Shot 2020-02-15 at 11 57 19 AM

Sample above was done using:

.atk-table-column-header {
    float: left;
    padding-bottom: 4px;
}

.atk-table-dropdown {
    float: right;
    margin-top: -4px;
}

@DarkSide666
Copy link
Member

@ibelar Why can't we set this CSS as default to look nice out-of-the-box?

@ibelar
Copy link
Contributor

ibelar commented Feb 17, 2020

@DarkSide666 - The best compromise is to have the dropdown trigger icon on the next line, under the column label name by default. This way, it will always remain the same, independently of the column width. We cannot take into account that there will be enough space in each column to properly fit the sorting icon and the filtering icon on the same line.

If we set CSS to have all icons on the same line by default, then, when the column width is changed and becomes not wide enough, (see picture below) we will end up with the filter icon placed on the next line anyway.

I believe that it is the developer responsibility to try placing it on the same line and live with the consequence. Only they will know what type of table they have to deal with. Plus, new CSS class introduced in PR #900 should give more freedom to adjust this to their needs.

see the same style set above with resize column.
Screen Shot 2020-02-17 at 9 03 17 AM

@georgehristov
Copy link
Collaborator

How about placing the filter icon in front of the column label and opening the popup on click of the icon and the label text?

@mvorisek
Copy link
Member

@ibelar can this be solved with modern flex css property?

@ibelar
Copy link
Contributor

ibelar commented Feb 17, 2020

@mvorisek - I am not a CSS guru, so maybe.

Guys, for me, this issue is closed. It might not be the prettiest solution but it is a workable one. There are workarounds to adapt to your needs, like changing CSS or using Table hook in order to generate your own column header.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

8 participants