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

GridFieldSortableHeader displays Filter after sorting #1835

Closed
manja opened this issue May 4, 2013 · 11 comments
Closed

GridFieldSortableHeader displays Filter after sorting #1835

manja opened this issue May 4, 2013 · 11 comments

Comments

@manja
Copy link
Contributor

manja commented May 4, 2013

GridField with SortableHeader component acts weird after sorting. On initial display everything is ok (as it should be), but after sorting content of the last column (always last one, no matter how many columns are there) header gets replaced with Filter icon. Spent over a day trying to fix it with @Zauberfisch on IRC.

Narrowed it down on GridFieldSortableHeader component, since when all other components are removed - bug still occurs.

Bug occurs on 3.0.5, 3.1 beta3 and latest build on May 4th, 2013. Tested on clean installs.

Initial display:
image

With two columns:

image

After sorting:
image

Two columns after sorting:

image

Code:
http://sspaste.com/paste/show/51852b75e9264

For two columns:
http://sspaste.com/paste/show/51852ceebf57f

@Zauberfisch
Copy link
Contributor

I think I already have a lead on where this is coming from.

I haven't followed up on it, but filter header inserts itself into the last as it seems. and given that you have no actions column it overwrites the one that exists.
considering that, I am not sure if the bug is in SortableHeader, it might also be in FilterHeader.
the reason the bug only appears when SortableHeader is included, is that FilterHeader does not add a header by it self, but relays on SortableHeader to do it

@manja
Copy link
Contributor Author

manja commented May 4, 2013

File: /framework/javascript/GridField.js
http://sspaste.com/paste/show/518532b6242ce

That fixed my problem - I simply wrapped functionality to replace content in last column if filter is hidden.

@chillu
Copy link
Member

chillu commented May 8, 2013

Care to submit a pull request? Presumably you've tested this across browsers?

@Zauberfisch
Copy link
Contributor

Consider this issue assigned to me

@Zauberfisch
Copy link
Contributor

Oh, it seems I have forgotten this issue.
@chillu could you please assign this to me. I will check if this is still valid and implement if required.

@ghost ghost assigned Zauberfisch Jan 5, 2014
@chillu
Copy link
Member

chillu commented Jan 13, 2014

Hey Mr. Fisch, any progress on this?

@Zauberfisch
Copy link
Contributor

its on the todo list :P

nah, in fact, I have scheduled some SilverStripe time this week.
currently working on userforms though, the framework issues will come later this week.

@wilr
Copy link
Member

wilr commented Jan 13, 2014

Anything in particular for userforms? 👍

@Zauberfisch
Copy link
Contributor

I believe this is not the right tread to discuss userforms, but I am redoing the pull request that I did a year ago (dropdowns with title=>value).

@tractorcow
Copy link
Contributor

Issue is caused by gridfield without actions column. Most components rely on this being a button column, not a data column.

Same problem, but different symptom to #3650

@kinglozzer
Copy link
Member

Fixed in SS4. While a fix for 3.x might be accepted, I don’t see any value in leaving this issue open

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

No branches or pull requests

7 participants