@virat
dude it is not solving my problem. please have a look on my code and
help me.....
private function onCreationComplete(event:FlexEvent):void
{
Alert.show("dfdfd
"+tempgrid.numChildren.toString(),"");
var max:int=0;
for(var i:int; i<tempgrid.numChildren;
i++)
{
var disObj:Object =
tempgrid.getChildAt(i);
if ( disObj is
mx.controls.listClasses.ListBaseContentHolder )
{
var holder :
ListBaseContentHolder = disObj as ListBaseContentHolder;
for(var j:int=0;
j<holder.rowInfo.length; j++)
{
if(max<
( holder.rowInfo[j] as ListRowInfo ).height)
max=( holder.rowInfo
[j] as ListRowInfo ).height;
//Alert.show
( ( holder.rowInfo[j] as ListRowInfo ).height.toString(),"" );
// wher u get
height each row
}
}
}
Report.maxRowHeight=max;
Alert.show(max.toString()+"
"+Report.maxRowHeight.toString(),"max ");
}
public function setpages():void{
var temparray:ArrayCollection;
var tarray:ArrayCollection=new ArrayCollection();
tempgrid.addEventListener
(FlexEvent.UPDATE_COMPLETE,onCreationComplete);
var tt:ArrayCollection=new ArrayCollection();
tt=queryData[0];
for(var u:int=0;u<26;u++)
tarray.addItem(tt[u]);
tempgrid.variableRowHeight=true;
tempgrid.setStyle("fontSize",8);
tempgrid.setStyle("textAlign","center");
tempgrid.setStyle("letterSpacing",0);
tempgrid.wordWrap=true;
tempgrid.verticalScrollPolicy="false";
tempgrid.variableRowHeight=true;
tempgrid.dataProvider=tarray;
Alert.show(maxRowHeight.toString(),"datainbox");
}
here alert show the value of maxRowHeight=0 while in
onCreationComplete it gives some value.....
i think it is because of that alert msg is displayed before call of
onCreationComplete function.
hw to fix it...
thanx and rgds
akhil
On Apr 24, 11:24 am, "v...@t" <[email protected]> wrote:
> Hello Akhil
>
> Yes it true that FlexEvent.CREATION_COMPLETE event of the DataGrid is
> not called.
>
> But you can use FlexEvent.UPDATE_COMPLETE event of the DataGrid for
> the same
>
> like .... it will solve your problem
>
> private var grid:DataGrid=new DataGrid();
> grid.addEventListener(FlexEvent.UPDATE_COMPLETE,onCreationComplete);
> grid.dataProvider = dataArraryCollection;
>
> Thanks
> Virat Patel
>
> On Apr 24, 10:49 am, Akhil Agrawal <[email protected]> wrote:
>
> > and creationComplete is of type FlexEvent. i had not found it for grid
> > creationcomplete
>
> > On Apr 24, 10:17 am, Akhil Agrawal <[email protected]> wrote:
>
> > > @virat
> > > i have to do this in action script not in mxml i m trying this bt
> > > giving error
>
> > > private var grid:DataGrid=new DataGrid();
> > > grid.creationComplete=onCreationComplete(event);
>
> > > how to resolve it in action script
> > > thanks and rgds
> > > akhil
>
> > > On Apr 23, 10:40 am, "v...@t" <[email protected]> wrote:
>
> > > > Hello Akhil
>
> > > > Just call onCreationComplete function on DataGrid's creationComplete
> > > > event.
>
> > > > <mx:DataGrid id="dg" width="400" variableRowHeight="true"
> > > > wordWrap="true" dataProvider="{arrData}"
> > > > creationComplete="onCreationComplete(event)" >
> > > > <mx:columns>
> > > > <mx:DataGridColumn dataField="name" headerText="Name" />
> > > > <mx:DataGridColumn dataField="cell" headerText="Phone" />
> > > > </mx:columns>
> > > > </mx:DataGrid>
>
> > > > Thanks
> > > > Virat Patel
>
> > > > On Apr 22, 5:51 pm, Akhil Agrawal <[email protected]> wrote:
>
> > > > > @ravi
> > > > > i think creationComplete event is associated with flex_event i m not
> > > > > getting how to call it for datagrid
> > > > > plz tell
>
> > > > > thanx and rgds
> > > > > akhil
>
> > > > > On Apr 22, 5:32 pm, Ravi Mishra <[email protected]> wrote:
>
> > > > > > Call it on the creationComplete event of your datagrid.
>
> > > > > > HTH,
>
> > > > > > -Ravi
>
> > > > > > On Apr 22, 5:29 pm, Akhil Agrawal <[email protected]> wrote:
>
> > > > > > > @virat
> > > > > > > thanks for ur rply. but problem is that it gives rowheight after
> > > > > > > completion of flex application while i want this infomation just
> > > > > > > after
> > > > > > > grid is greated how can i do this??
>
> > > > > > > thanx and rgds
> > > > > > > akhil agrawal
>
> > > > > > > On Apr 22, 11:52 am, "v...@t" <[email protected]> wrote:
>
> > > > > > > > Hello
>
> > > > > > > > I have done some work as per your problem, may it helps you..
>
> > > > > > > > In this you ll get each row height of DataGrid so you can use
> > > > > > > > it.
>
> > > > > > > > <?xml version="1.0" encoding="utf-8"?>
> > > > > > > > <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
> > > > > > > > layout="vertical"
> > > > > > > > horizontalAlign="center" verticalAlign="middle"
> > > > > > > > creationComplete="onCreationComplete(event)">
>
> > > > > > > > <mx:Script>
> > > > > > > > <![CDATA[
> > > > > > > > import mx.managers.SystemManager;
> > > > > > > > import mx.events.FlexEvent;
> > > > > > > > import mx.collections.ArrayCollection;
> > > > > > > > import mx.controls.listClasses.*;
>
> > > > > > > > [Bindable] private var arrData :
> > > > > > > > ArrayCollection = new
> > > > > > > > ArrayCollection
> > > > > > > > ([
> > > > > > > >
> > > > > > > > {name:"abcdefghijklmnopqrstuvwxyz1234567890",call:"4444"},
> > > > > > > > {name:"hello1234",call:"5555"},
>
> > > > > > > > {name:"abcdefghijklmnopqrstuvwxyz09876543211234567890abcdefghijklmnopqrstuv
> > > > > > > > wxyz09876543211234567890",call:"1111"},
> > > > > > > > {name:"call12345",call:"2222"}
> > > > > > > > ]);
>
> > > > > > > > private function
> > > > > > > > onCreationComplete(event:FlexEvent):void
> > > > > > > > {
> > > > > > > > for(var i:int;
> > > > > > > > i<dg.numChildren; i++)
> > > > > > > > {
> > > > > > > > var disObj:Object =
> > > > > > > > dg.getChildAt(i);
> > > > > > > > if ( disObj is
> > > > > > > > mx.controls.listClasses.ListBaseContentHolder )
> > > > > > > > {
> > > > > > > > var holder :
> > > > > > > > ListBaseContentHolder = disObj as
> > > > > > > > ListBaseContentHolder;
> > > > > > > > for(var
> > > > > > > > j:int=0; j<holder.rowInfo.length; j++)
> > > > > > > > {
> > > > > > > > trace (
> > > > > > > > ( holder.rowInfo[j] as ListRowInfo ).height );
> > > > > > > > // wher
> > > > > > > > u get height each row
> > > > > > > > }
> > > > > > > > }
> > > > > > > > }
> > > > > > > > }
> > > > > > > > ]]>
> > > > > > > > </mx:Script>
>
> > > > > > > > <mx:DataGrid id="dg" width="400"
> > > > > > > > variableRowHeight="true"
> > > > > > > > wordWrap="true"
> > > > > > > > dataProvider="{arrData}" >
> > > > > > > > <mx:columns>
> > > > > > > > <mx:DataGridColumn dataField="name"
> > > > > > > > headerText="Name" />
> > > > > > > > <mx:DataGridColumn dataField="cell"
> > > > > > > > headerText="Phone" />
> > > > > > > > </mx:columns>
> > > > > > > > </mx:DataGrid>
>
> > > > > > > > </mx:Application>
>
> > > > > > > > Thanks
> > > > > > > > Virat Patel
>
> > > > > > > > On Apr 22, 9:28 am, Akhil Agrawal <[email protected]>
> > > > > > > > wrote:
>
> > > > > > > > > grid height is fixed bt no. of rows may vary according to
> > > > > > > > > data if data
> > > > > > > > > in a row is large grid may contain less no. of rows else
> > > > > > > > > greater ie.
> > > > > > > > > rowcount should depend on data displayed in grid at run time
> > > > > > > > > how it is
> > > > > > > > > possible
>
> > > > > > > > > On Apr 21, 7:48 pm, Jagadish M <[email protected]> wrote:
>
> > > > > > > > > > Hi Akhil,
>
> > > > > > > > > > According to your mail, I mean that you don't want to
> > > > > > > > > > display any
> > > > > > > > > > scrollbars, the grid height should be increased as the data
> > > > > > > > > > increased..
> > > > > > > > > > for that you hav to use a small property
> > > > > > > > > > *rowCount="{ac.length}" *
>
> > > > > > > > > > Here the ac is arraycollection
> > > > > > > > > > for ex:
> > > > > > > > > > <mx:DataGrid id="dg" dataProvider="{ac}" click="cli()"
> > > > > > > > > > rowCount="{ac.length}"
> > > > > > > > > > />
>
> > > > > > > > > > On Tue, Apr 21, 2009 at 6:24 PM, Akhil Agrawal
> > > > > > > > > > <[email protected]>wrote:
>
> > > > > > > > > > > hi all,
> > > > > > > > > > > i am creating datagrid at runtime by providing data.
> > > > > > > > > > > problem is that
> > > > > > > > > > > grid height is fixed but data may be of variable length
> > > > > > > > > > > so how can i
> > > > > > > > > > > decide the no. of rows in a grid at run time ie. how can
> > > > > > > > > > > i find the
> > > > > > > > > > > max row height in the grid
>
> > > > > > > > > > > thanxs
>
> > > > > > > > > > --
> > > > > > > > > > Thanks & Regards,
>
> > > > > > > > Jagan Mady's
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Flex
India Community" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/flex_india?hl=en
-~----------~----~----~----~------~----~------~--~---