Hi Alex, 

Thanks for your message and all explanation. 

Effectively I didn't see DataGridPercentageLayout bead because when
using code completion there is only DataGridPercentageView wich is show
and I don't think to look at SDK files content. (
DataGridPercentageLayout is not usable in mxml) 

So I used DataGridPercentageLayout like this :

        .PercentageColumnWidths { 
            IBeadLayout:
ClassReference("org.apache.royale.html.beads.layouts.DataGridPercentageLayout");

        } 
  and add className="PercentageColumnWidths" to DataGrid 

This is working great ! So no need to change it. (and no need to add
DataGridPercentageView in mxml, I didn't investiguate why...) 

Thank a lot for your work 

Regards 

Le 21.10.2019 17:54, Alex Harui a écrit :

> Hi, 
> 
> I see a DataGridPercentageLayout bead, which you did not mention, so you 
> probably need that to go with DataGridPercentageView.  If that doesn't work, 
> let us know, however, I've got a lot of other issues in my queue before I can 
> take a serious look at this. 
> 
> However, one thing to keep in mind about Basic and Express is that they 
> emphasize the Pay-as-you-go (PAYG) philosophy, which is quite different from 
> Flex which was more of a one-size-fits-all philosophy.  Your situation is a 
> good example of the difference PAYG creates between Flex and Royale. 
> 
> In Flex (and in fact, in the MXRoyale DataGrid) the DataGridColumn has a 
> width property that could take percentage or an actual number.  This requires 
> code to check if the DataGridColumn is using percentage or actual number.  
> This extra checking occurred in many places in Flex in order to have one 
> DataGrid that could do anything and other optional features of other 
> components (one-size-fits-all).   This made it easier to get started in Flex 
> because you could just add a DataGrid and configure it to your needs, but all 
> of that extra checking needed to be downloaded and run, and it was very rare 
> for someone to want to switch a DataGridColumn from percentage to actual 
> number at runtime. 
> 
> So, in Royale Basic, you choose the beads at compile time that dictate if the 
> DataGrid is going to use percentages for columns or not.  There is a default 
> (actual numbers) but you can get percentages if you need it.  But not only do 
> you need to use a DataGridPercentageView, but you also need to use the 
> DataGridPercentageLayout.  So this is more configuration up front, but in the 
> end, if you only have one DataGrid and it is using percentages, then you will 
> be downloading and running the least amount of code by not carrying around 
> the checks for whether you are using percentages or actual numbers and the 
> code that does layout with actual numbers. 
> 
> Meanwhile, the Express package pre-packages more beads.  Someone could create 
> a set of beads and an Express DataGridColumn that supports your suggestion of 
> having a width property that supports either percentage or actual numbers and 
> add the right Basic beads for that DataGrid.  Or maybe we need a 
> DataGridPercentageWidthColumn.  Or create a set of heavier beads that 
> combines the current actual and percentage beads for DataGrid.  But the Basic 
> DataGridColumn would not have a width property that can handle either 
> percentage or actual numbers.  That kind of thing would go in Express, Jewel, 
> and or other not-so-basic libraries. 
> 
> HTH, 
> 
> -Alex 
> 
> From: "[email protected]" <[email protected]>
> Organization: Cristallium
> Reply-To: "[email protected]" <[email protected]>, 
> "[email protected]" <[email protected]>
> Date: Monday, October 21, 2019 at 3:45 AM
> To: "[email protected]" <[email protected]>
> Subject: [Discuss] DataGrid DataGridColumn basic component 
> 
> Hi Guys, 
> 
> I try to get a DataGrid working. 
> 
> Tried basic and express one, the basic is the one wich seem working except 
> that we can only use fixed column width. (because DataGridColumn's 
> columnWidth accept only strict number and there is no width property 
> available) 
> 
> There is an issue with bead named DataGridPercentageView  because % width is 
> overwritten on layoutNeeded event by DataGridLayout  
> 
> If we look at DataGridColumn class It seems to me that the property 
> columnWidth (accept only strict number like 50, not '50%' ) should be renamed 
> by width  that would accept number with % or without and that DataGridLayout 
> should handle this. Moreover DataGridPercentageView bead would be useless and 
> we could delete this bead. 
> 
> Could I have your opinions ? thanks 
> 
> Regards

Reply via email to