I have a table that will scroll right if the columns cannot all be displayed on the screen. The problem is that the column headings do not scroll right also. I am using col_width(Fit) for all my columns and Layout_Width('Fill, 700') for my table. The column headings will scroll right if I make my columns have specific widths, or even if I limit my "Fit" to a single column. Any ideas for setting this up? Here is the code for the Set_Table and the Set_Label for the columns in the row:
#COM_OWNER.Set_Table Name(Products) Layout_Height(Fill) Border_Thickness(1) Border_Color('#dddddd') Layout_Col(1) Layout_Row(1) Border_Cornerradius(15)
#com_owner.set_Table Name(Products) Col_N(1) Col_Name(ORDER) Col_Width(Fit)
#COM_OWNER.Set_Table Name(Products) Col_N(2) Col_Name(ODATE) Col_Width(Fit)
#COM_OWNER.Set_Table Name(Products) Col_N(3) Col_Name(CUSTOMER) Col_Width(Fit)
#COM_OWNER.Set_Table Name(Products) Col_N(4) Col_Name(QTY) Col_Width(Fit)
#COM_OWNER.Set_Table Name(Products) Col_N(5) Col_Name(PRICE) Col_Width(Fit)
#COM_OWNER.Set_Table Name(Products) Col_N(6) Col_Name(EXTENSION) Col_Width(Fit)
* Set up Column Headers
#com_owner.set_Label Name('Products.Col#1.HEADER') Text('Order #') Textalign(right)
#COM_OWNER.Set_Label Name('Products.Col#2.HEADER') Text('Date') Textalign(right)
#COM_OWNER.Set_Label Name('Products.Col#3.HEADER') Text('Customer')
#COM_OWNER.Set_Label Name('Products.Col#4.HEADER') Text('Qty') Textalign(right)
#COM_OWNER.Set_Label Name('Products.Col#5.HEADER') Text('Price') Textalign(right)
#COM_OWNER.Set_Label Name('Products.Col#6.HEADER') Text('Extension') Textalign(Right)
* Basic Table set up
#uEntry := 0
Select Fields(#prodsales) From_File(oetoil92) With_Key(#ITEM)
Fetch Fields(#prodsales) From_File(oetohp) With_Key(#COID)
#uEntry += 1
*
#TableRow := 'Products.Row%' + #uEntry.AsString
#COM_OWNER.Set_Label Name(#TableRow + '.ORDER') Text(#COID.AsString) Textalign(right)
#COM_OWNER.Set_Label Name(#TableRow + '.ODATE') Text(#OHRFDT.AsDate( CCYYMMDD ).AsDisplayString( MMsDDsYY )) Textalign(right)
#COM_OWNER.Set_Label Name(#TableRow + '.CUSTOMER') Text(#CUSID)
#COM_OWNER.Set_Label Name(#TableRow + '.QTY') Text(#OIQTNY.AsString) Textalign(right)
#COM_OWNER.Set_Label Name(#TableRow + '.PRICE') Text(#OIPRC.AsString) Textalign(right)
#COM_OWNER.Set_Label Name(#TableRow + '.EXTENSION') Text(#VOIEXNTS.AsString) Textalign(right)
Endselect
Table layout (RDMLX)
-
tsupartono
- Posts: 289
- Joined: Wed Apr 18, 2012 10:21 am
Re: Table layout (RDMLX)
David,
At this stage, the only way to get the table headings to scroll right is by allowing the table to be as wide as required to fit all the columns.
For that to happen, you should leave the Width of the table to the default of FIT (as opposed to FILL).
So if you remove the Layout_Width('Fill, 700') you are currently setting for your table, it will scroll right.
At this stage, the only way to get the table headings to scroll right is by allowing the table to be as wide as required to fit all the columns.
For that to happen, you should leave the Width of the table to the default of FIT (as opposed to FILL).
So if you remove the Layout_Width('Fill, 700') you are currently setting for your table, it will scroll right.
Re: Table layout (RDMLX)
I have found a great way to set this correctly for all devices. Use the #com_owner.devicewidth to get the minimum width of the table like this:
#std_text := 'Fit,' + #COM_OWNER.DevicePixelWidth.AsString
#com_owner.set_Form Title('My Form') Grid_Col_N(1) Grid_Col_Width(#std_text) Grid_Row_N(1) Grid_Row_Height(Fill)
#COM_OWNER.Set_Table Name(Products) Layout_Height(Fill) Border_Thickness(1) Border_Color('#dddddd') Layout_Col(1) Layout_Row(1) Border_Cornerradius(15) Layout_Width(#std_text)
#std_text := 'Fit,' + #COM_OWNER.DevicePixelWidth.AsString
#com_owner.set_Form Title('My Form') Grid_Col_N(1) Grid_Col_Width(#std_text) Grid_Row_N(1) Grid_Row_Height(Fill)
#COM_OWNER.Set_Table Name(Products) Layout_Height(Fill) Border_Thickness(1) Border_Color('#dddddd') Layout_Col(1) Layout_Row(1) Border_Cornerradius(15) Layout_Width(#std_text)
Regards,
David
David
Re: Table layout (RDMLX)
DevicePixelWidth is not recognized in my RDMLX code
Why am I getting this message? I copied/pasted straight from the sample code (and changed the field name)
Why am I getting this message? I copied/pasted straight from the sample code (and changed the field name)
-
Paul
Re: Table layout (RDMLX)
A few things to check;
Does your RDMLX form view extend #LRNG_FORM?
Do you get other errors in your RDMLX form view?
Has #LRNG_FORM or #LRNG_SRV been modified from your LANSA IDE? For instance can you use IDE prompting to get this reference?
Does your RDMLX form view extend #LRNG_FORM?
Do you get other errors in your RDMLX form view?
Has #LRNG_FORM or #LRNG_SRV been modified from your LANSA IDE? For instance can you use IDE prompting to get this reference?
Re: Table layout (RDMLX)
Yes LRNG_FORM.
No modifications to the #LRNG_FORM or #LRNG_SRV. I can prompt for the .DevicePixelWidth
no other errors in the source.
FYI - There was another property in LongRange that I got the same error (I forget which one) but I didn't need it, I was just experimenting. I figured it was properties/methods that haven't been fully completed in the beta.
No modifications to the #LRNG_FORM or #LRNG_SRV. I can prompt for the .DevicePixelWidth
no other errors in the source.
FYI - There was another property in LongRange that I got the same error (I forget which one) but I didn't need it, I was just experimenting. I figured it was properties/methods that haven't been fully completed in the beta.
-
tsupartono
- Posts: 289
- Joined: Wed Apr 18, 2012 10:21 am
Re: Table layout (RDMLX)
It's best not to use DeviceWidth & DeviceHeight as they are mostly informative only and does not take into account device orientation.
Better way to do this is by setting the G-Column's minimum width to 100% (as opposed to DeviceWidth).
#std_text := 'Fit,100%'
#com_owner.set_Form Title('My Form') Grid_Col_N(1) Grid_Col_Width(#std_text) Grid_Row_N(1) Grid_Row_Height(Fill)
We also need to remove the Layout_Width from the table itself because we don't need it anymore (it will follow the width of the G-Column).
#COM_OWNER.Set_Table Name(Products) Layout_Height(Fill) Border_Thickness(1) Border_Color('#dddddd') Layout_Col(1) Layout_Row(1) Border_Cornerradius(15) Layout_Width(#std_text)
Better way to do this is by setting the G-Column's minimum width to 100% (as opposed to DeviceWidth).
#std_text := 'Fit,100%'
#com_owner.set_Form Title('My Form') Grid_Col_N(1) Grid_Col_Width(#std_text) Grid_Row_N(1) Grid_Row_Height(Fill)
We also need to remove the Layout_Width from the table itself because we don't need it anymore (it will follow the width of the G-Column).
#COM_OWNER.Set_Table Name(Products) Layout_Height(Fill) Border_Thickness(1) Border_Color('#dddddd') Layout_Col(1) Layout_Row(1) Border_Cornerradius(15) Layout_Width(#std_text)