We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Native relationships field + grid

Developer Preview

Leevi Graham's avatar
Leevi Graham
1,143 posts
12 years ago
Leevi Graham's avatar Leevi Graham

Looks like the native rels field hasn’t been tested with grid.

The following doesn’t work:

  • Autocomplete
  • Selections

Additionally there is some UI issues:

  • Remove icon is inconsistent with Relationships
  • If no width is entered in Grid the html attribute is 0%. No attribute should be added so the table cells flex more naturally for cells with little information.
  • Cell width should be able to be set in px as well.

Cheers Leevi

       
Kevin Cupp's avatar
Kevin Cupp
791 posts
12 years ago
Kevin Cupp's avatar Kevin Cupp

Thanks, Leevi. I’m unable to reproduce your problems with Relationships but I’ll forward them on to Pascal for ideas.

I talked with James about the UI issues:

  • The remove icons are as intended for the context they are in, they were not meant to be the same. The smaller red X is for internal row closes and the circled X is for external row closes. You can follow up with James if you’d like to discuss further.
  • We’d rather not rely on the browser to make the correct decision with deciding column widths, it can be unpredictable and may not produce what’s expected, we’d rather leave each column equally proportioned if no width is specified.
  • We’d rather not set anything horizontally in pixels. To plan for the future, it needs to be responsive and pixels don’t flex. Percentages for horizontal settings are required for flexibility, as they are relative to the viewport. Pixels are absolute, and the viewport will not affect their size horizontally.

Thanks for the feedback, let us know if you run into anything else. Again, I’ll let Pascal know about your Relationships issues.

       
Leevi Graham's avatar
Leevi Graham
1,143 posts
12 years ago
Leevi Graham's avatar Leevi Graham
- We’d rather not set anything horizontally in pixels. To plan for the future, it needs to be responsive and pixels don’t flex. Percentages for horizontal settings are required for flexibility, as they are relative to the viewport. Pixels are absolute, and the viewport will not affect their size horizontally.

I still don’t think that is a good approach. Browsers are pretty smart when it comes to deciding widths. Combined with min-width (or px width) on content inside the table there will always be a reasonable result.

Attached was my first test with grid. The checkbox cell is way to big. I would be hesitant to put a width on some of those cells because I don’t want them to be too small at smaller resolutions.

       
Kevin Cupp's avatar
Kevin Cupp
791 posts
12 years ago
Kevin Cupp's avatar Kevin Cupp

Sorry, Leevi, we think it’s important in planning for the future of EE’s CP.

On another note I was able to reproduce your problem with Relationships, I’ll make sure that gets taken care of.

       
Leevi Graham's avatar
Leevi Graham
1,143 posts
12 years ago
Leevi Graham's avatar Leevi Graham

I don’t mean to be pedantic about this but what possible reason could there be for fixing the widths to equal percentages? How does this affect future planning of EE’s CP?

       
Leevi Graham's avatar
Leevi Graham
1,143 posts
12 years ago
Leevi Graham's avatar Leevi Graham

Given my screenshot example above auto column widths would have meant that the rel field would have been much larger and actually usable. I don’t think I can achieve this by setting the % widths of all the cells. As I said before this would cause the checkbox cells to be too small if the browser window was collapsed.

       
Kevin Cupp's avatar
Kevin Cupp
791 posts
12 years ago
Kevin Cupp's avatar Kevin Cupp

I was talking more about the decision to not allow pixel widths since that was the part you quoted. In regards to the column widths, I just set up the same example you did, removed the widths to test to see what would happen, and there was no change (see screenshot). If the browser isn’t even going to do what’s expected, we might as well be explicit about the widths.

       
Kevin Cupp's avatar
Kevin Cupp
791 posts
12 years ago
Kevin Cupp's avatar Kevin Cupp
Given my screenshot example above auto column widths would have meant that the rel field would have been much larger and actually usable. I don’t think I can achieve this by setting the % widths of all the cells. As I said before this would cause the checkbox cells to be too small if the browser window was collapsed.

I don’t think specifying percentages is a big deal. Here I guestimated a width of 20% 20% 60% for the cells and it works fine at small resolutions and larger.

       
Leevi Graham's avatar
Leevi Graham
1,143 posts
12 years ago
Leevi Graham's avatar Leevi Graham
If the browser isn’t even going to do what’s expected, we might as well be explicit about the widths.

There are other rules that are still forcing the width in your screenshot. table-layout:fixed is the main culprit.

By setting the th and tds as width:auto and removing table-layout:fixed the result is much better than fixed or defined %. This could be tidied up even more by applying min-width to the rte and rel fields.

       
Kevin Cupp's avatar
Kevin Cupp
791 posts
12 years ago
Kevin Cupp's avatar Kevin Cupp

Oh you’re right, Leevi, I forgot I added that CSS property in there. I talked with James a bit more about it, and we don’t really have a compelling argument to not allow this other than we kind of like it the other way, but with some quick testing I just did, I can see it can actually be useful and might work out. I’ll do some more testing and tweaking (min-width stuff) and put it in for the next dev preview if all goes well. Thanks!

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.