Is there an easy way to justify the grids in a column on a column by column basis rather than applying the justification to the whole grid?
For example say I need the first and second column to be left justified, but the 3rd and 4th column I need to be centered, and the 5th and 6th column I need to be right justified. Is this possible to do with the Genie tool?
column justification
-
- Profound User
- Posts: 48
- Joined: Wed Apr 12, 2017 4:44 pm
- First Name: Darin
- Last Name: McCammon
- Company Name: NAICO
- Phone: 4052584301
- Address 1: 1010 Manvel Ave
- City: Chandler
- State / Province: Oklahoma
- Zip / Postal Code: 74834
- Country: United States
- Contact:
-
- Experienced User
- Posts: 2711
- Joined: Wed Aug 01, 2012 8:58 am
- First Name: Scott
- Last Name: Klement
- Company Name: Profound Logic
- City: Milwaukee
- State / Province: Wisconsin
Re: column justification
Are you referring to the "text align" property? We don't have one called "justification", but this would be the closest thing, I think.
If so, you can choose "other" for the property, and this will let you type into the property box (instead of using the drop down). You can then set the property to a separate value for each column... so if you had three columns, you wanted the first one to be left aligned, the second to be centered, and the third to be right aligned, you could click Other and set it to left,center,right
Assuming that you are referring to data on a 5250 screen, however... there is one caveat: 5250 data is generally padded with blanks. So if you have a 5 character field where you see "X", it actually will contain "X-blank-blank-blank-blank" That can really screw up text alignment, because the blanks are included in that alignment -- but. that's the way 5250 works, unfortunately.
If this weren't a grid, you could fix it by changing the "value" property of the widget. The default is "script: value" and you could change it to "script: trim(value)" to remove the blanks. But, that's not so easy in a 5250 grid because the data is automatically "consumed" from the screen and put into the grid, so you don't have a value property like you would with a simple output field.
Never really thought about how you'd override the text-align in that case. I guess you could write JavaScript code that would loop through the grid and remove the blanks... kinda awkward, but it'd work.
If so, you can choose "other" for the property, and this will let you type into the property box (instead of using the drop down). You can then set the property to a separate value for each column... so if you had three columns, you wanted the first one to be left aligned, the second to be centered, and the third to be right aligned, you could click Other and set it to left,center,right
Assuming that you are referring to data on a 5250 screen, however... there is one caveat: 5250 data is generally padded with blanks. So if you have a 5 character field where you see "X", it actually will contain "X-blank-blank-blank-blank" That can really screw up text alignment, because the blanks are included in that alignment -- but. that's the way 5250 works, unfortunately.
If this weren't a grid, you could fix it by changing the "value" property of the widget. The default is "script: value" and you could change it to "script: trim(value)" to remove the blanks. But, that's not so easy in a 5250 grid because the data is automatically "consumed" from the screen and put into the grid, so you don't have a value property like you would with a simple output field.
Never really thought about how you'd override the text-align in that case. I guess you could write JavaScript code that would loop through the grid and remove the blanks... kinda awkward, but it'd work.
-
- Profound User
- Posts: 48
- Joined: Wed Apr 12, 2017 4:44 pm
- First Name: Darin
- Last Name: McCammon
- Company Name: NAICO
- Phone: 4052584301
- Address 1: 1010 Manvel Ave
- City: Chandler
- State / Province: Oklahoma
- Zip / Postal Code: 74834
- Country: United States
- Contact:
Re: column justification
For whatever reason, this is not working for me. And yes, I meant the alignment option. I am not sure what is keeping it from working, I have checked my CSS and cannot find anything that would over-ride the alignment assigned in the Genie design screen. But the columns are not responding.
-
- Experienced User
- Posts: 2711
- Joined: Wed Aug 01, 2012 8:58 am
- First Name: Scott
- Last Name: Klement
- Company Name: Profound Logic
- City: Milwaukee
- State / Province: Wisconsin
Re: column justification
Maybe the extra blanks? (see my explanation, above.)
-
- Profound User
- Posts: 48
- Joined: Wed Apr 12, 2017 4:44 pm
- First Name: Darin
- Last Name: McCammon
- Company Name: NAICO
- Phone: 4052584301
- Address 1: 1010 Manvel Ave
- City: Chandler
- State / Province: Oklahoma
- Zip / Postal Code: 74834
- Country: United States
- Contact:
Re: column justification
I read the explanation in your previous post. But I would expect that at least some of the columns in some of the grids would move at least a little. But it makes no difference to the grid at all if I choose to left justify, right justify, center, or choose other and create a column by column justification separated with commas.
-
- Experienced User
- Posts: 2711
- Joined: Wed Aug 01, 2012 8:58 am
- First Name: Scott
- Last Name: Klement
- Company Name: Profound Logic
- City: Milwaukee
- State / Province: Wisconsin
Re: column justification
I'm pretty sure it's because the columns are completely full (filled with blanks) since there's no extra space left to move to the left/right it would not look any different.
I haven't tried it, though. Perhaps I should run a quick test and see...
I haven't tried it, though. Perhaps I should run a quick test and see...
-
- Experienced User
- Posts: 2711
- Joined: Wed Aug 01, 2012 8:58 am
- First Name: Scott
- Last Name: Klement
- Company Name: Profound Logic
- City: Milwaukee
- State / Province: Wisconsin
Re: column justification
I ran a test, and this turned out to be really difficult to remove the blanks. Once I finally got that working, I can confirm what you said -- the "text align" property doesn't work because of the way Genie consumes the data from the screen.
So unfortunately, this feature will not work from 5250 data. It will work (in Genie or Rich Display) when loaded from a database-driven grid, just not from 5250 data.
You could use JavaScript or CSS to change the text alignment instead of the property. Awkward, but it'd work...
So unfortunately, this feature will not work from 5250 data. It will work (in Genie or Rich Display) when loaded from a database-driven grid, just not from 5250 data.
You could use JavaScript or CSS to change the text alignment instead of the property. Awkward, but it'd work...
Who is online
Users browsing this forum: Google [Bot] and 0 guests