Royale tries to rely on two paths: 1) width/heightSizedToContent 2) parent sizes the component.
There is a 3rd path where the width/height is set which usually goes down path #1. I've seen some situations where the isWidthSizedToContent gets fooled and the problem is making that smarter. Otherwise, in case #2, you are welcome to skip laying out in initComplete if you can rely on the widthChanged/heightChanged/sizeChanged events as the parent sizes the child. However I think there may be some holes in that for some flexbox and other fancy CSS layouts. Some layouts in the parent don't set the child's width/height, they just set the CSS and let the browser size everything. It may be those layouts need to at least send a sizeChanged to each child. HTH, -Alex On 3/9/20, 3:50 PM, "Carlos Rovira" <[email protected]> wrote: Hi, now that I get Jewel DataGrid width and height solved I want to ask about a problem I found while developing it: At the time the Jewel DataGrid start to be instantiated the DataGridLayout run at the end of the DataGridView's "initComplete" event handler (that I assume is the final point where all should be set and ready. At that time width and percentWidth is not known by the _strand or by internal view components (in this case listArea part or internal column lists). For example width or height could be 0 for each component named before when set up to percentage. Just is a pixel right value when set up to a concrete pixel value. (note: that the problem is really for components that does not define width/height or use % values). So I finally need to use requestAnimationFrame check [1] until I get right values. So that part could be right for JS way of doing things, but I think is a bit of a hack and want to know if other's known a better way to do it. Maybe I need to request a "layoutNeeded" in other place. Thanks [1] https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fapache%2Froyale-asjs%2Fblob%2F5a73eb51d73f7b5f43df36098518a2af9072ef4f%2Fframeworks%2Fprojects%2FJewel%2Fsrc%2Fmain%2Froyale%2Forg%2Fapache%2Froyale%2Fjewel%2Fbeads%2Flayouts%2FDataGridLayout.as%23L111&data=02%7C01%7Caharui%40adobe.com%7Cef0b32ce57994738ca0808d7c47c4043%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637193910240617036&sdata=JO9ZaSOoWXvjLuvJ16lwAqpbcdu9QcXVsGVmNkrNXOw%3D&reserved=0 -- Carlos Rovira https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fabout.me%2Fcarlosrovira&data=02%7C01%7Caharui%40adobe.com%7Cef0b32ce57994738ca0808d7c47c4043%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637193910240617036&sdata=X1xBafwREW4WyE%2F4XnO2WdONeYTjJmnAm39kNL0mkRI%3D&reserved=0
