On 3/15/20, 2:59 AM, "Carlos Rovira" <[email protected]> wrote:    
    
    >
    > Maybe you can explain what 100% means for Jewel DG and what component
    > needed an actual number.
    >
    
    In Jewel DG, the build components are the same as in Basic, but we use flex
    to ease how it appears in screen (flex column to make header over listArea,
    then listArea uses Horizontal layout to layout columns. Then internal
    columns need to find the width measure via columnWidth values (that could
    be not set or set some). So width 100% means, that DG needs to get all the
    width available space and then if a column has collumnWidth, that column
    knows the exact pixels in width. But the rest must calculate how many
    pixels are left and give the proportion part to each of those columns left.
    
    The height algorithm seems to work right. The width algorithm is working
    for all cases except width set to a percentage.
    
IMO, if you are using width=100% to mean what it means in CSS for just about 
everything else in Jewel, you may want to reconsider the API of DataGridColumn 
in Jewel.  Otherwise, you will be struggling to catch the width setter and 
block it from being set on element.styles and then trying to compute actual 
numbers instead.  That's how MXRoyale works, but MXRoyale does not use any 
other browser layout like display="flex" or even display="blocK" so it always 
computes sizes.

MXRoyale does that because in Flex, width=100% did not mean what it means in 
CSS.  In Flex it means 100% of the available space after other fixed sized 
children are accounted for, and then a relative scaling of there are other 
children with % such that the total of percentages > 100.

IMO, you are not under any obligation to use % in the Flex way in only one 
component in Jewel. I would recommend that you add other APIs instead.  Yeah, 
that will mean that folks used to Flex DG will stumble a bit when migrating, 
but I think anyone who chooses Jewel has given up on 100% backward 
compatibility to get a modern UI and have touched their old UI in many places 
already or tossed the old UI and are starting over.

So, DGColumn APIs that more directly map to CSS FlexBox relative weighting 
might be best.  It is relatively well-documented on the internet and using the 
browser to lay it out will perform better.

My 2 cents,
-Alex


 

Reply via email to