Ok, heres an odd one.

Normally, I can use bindings to specify widths of DataGridColumns (a trick i use to set a % width), like so:

<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml";>
<mx:Model id="sizes">
<size1>{this.width*.28}</size1>
<size2>{this.width*.08}</size2>
</mx:Model>
<mx:DataGrid id="dg" >
<mx:columns>
<mx:Array>
<mx:DataGridColumn textAlign="left" columnName="name" width="{sizes.size1}" />
<mx:DataGridColumn textAlign="right" columnName="city" width="{sizes.size1}"/>
<mx:DataGridColumn textAlign="right" columnName="state" width="{sizes.size1}"/>
<mx:DataGridColumn textAlign="right" columnName="zip" width="{sizes.size2}"/>
</mx:Array>
</mx:columns>
</mx:DataGrid>
</mx:Application>


however, if the datagrid appears in a repeater, it suddenly stops working.

<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml";>
<mx:Model id="sizes">
<size1>{this.width*.28}</size1>
<size2>{this.width*.08}</size2>
</mx:Model>
<mx:Model id="x2">
<one></one>
<one></one>

</mx:Model>
<mx:Repeater dataProvider="{x2.one}">
<mx:DataGrid id="dg" >
<mx:columns>
<mx:Array>
<mx:DataGridColumn textAlign="left" columnName="name" width="{sizes.size1}" />
<mx:DataGridColumn textAlign="right" columnName="city" width="{sizes.size1}"/>
<mx:DataGridColumn textAlign="right" columnName="state" width="{sizes.size1}"/>
<mx:DataGridColumn textAlign="right" columnName="zip" width="{sizes.size2}"/>
</mx:Array>
</mx:columns>
</mx:DataGrid>
</mx:Repeater>
</mx:Application>


I'm not looking for a debate on the merits of looping over datagrids, but am puzzled by this odd break in behavior. I thought perhaps I was losing scope while in the repeater, but that doesnt seem to be the case, as if i add width="{sizes.size1*3+sizes.size2}" to the DataGrid itself, the grid is sized to the right width, but the columns are all equally spaced.

Anyone know whats going on here?

At 10:18 AM 11/27/2004, you wrote:
We do have the request in our system already.

-----Original Message-----
From: Mitch Aunger [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 25, 2004 8:32 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] DataGridColumn resize width request (was: Question on heightTo property of mx.effects. Resize)


Is there an open request to add support for percentage values on the
column widths for the DataGrid as well?

Ex of what I'd like to see:
<mx:DataGridColumn columnName="NUMBER" headerText="Order" width="10%" />

Tho that currently throws an error:
Error /gcc/gccAppDemoOrders.mxml:10
Type mismatch in assignment statement: found String where Number is required.

I really really really would like to be able to set widths for
DataGridColumns as percentages PLEASE? It would seem to be very
important to me to be able to have the DataGrid be FLEXible in size
via percentages and have the DataGridColumns grow and shrink by %ages
too :)

Any other votes?

Thanks

Mitch

The "World's Finest" Candles!
Strongest scent on the market
<http://www.showmescents.com/>http://www.showmescents.com/

Independent Distributor for Gold Canyon Candles

On Wed, 24 Nov 2004 11:49:30 -0800, Jason Szeto <[EMAIL PROTECTED]> wrote:
>
>
>
> The resize effect does not support percent based values. However, this is a
> good enhancement request. I'll add it to our list.
>
>
>
> Jason
>



Yahoo! Groups Sponsor
ADVERTISEMENT
<http://us.ard.yahoo.com/SIG=129hob5va/M=298184.5639630.6699735.3001176/D=groups/S=1705007207:HM/EXP=1101655102/A=2434970/R=0/SIG=11edksnhv/*http://www.netflix.com/Default?mqso=60185402>
click here



----------
Yahoo! Groups Links
* To visit your group on the web, go to:
* <http://groups.yahoo.com/group/flexcoders/>http://groups.yahoo.com/group/flexcoders/


*
* To unsubscribe from this group, send an email to:
* <mailto:[EMAIL PROTECTED]>[EMAIL PROTECTED]


*
* Your use of Yahoo! Groups is subject to the <http://docs.yahoo.com/info/terms/>Yahoo! Terms of Service.





Reply via email to