Please find something i was trying to do into simple format. I have a file Test TestDatagrid.mxml as: <?xml version="1.0" encoding="utf-8"?><mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" viewSourceURL="srcview/index.html"> <mx:Script> <![CDATA[ import mx.controls.Alert; public function test1():void { if (test == null) { Alert.show("test is null"); } else { Alert.show("..." + test); } } ]]> </mx:Script> <mx:Panel x="0" y="0" width="500" height="500" layout="absolute" title="DataGrid - Simple DataProvider"> <mx:DataGrid id="test" x="0" y="0" height="116" width="359" rowCount="4"> <mx:dataProvider > <mx:Object name="World of Warcraft" creator="Blizzard" publisher="Blizzard" /> </mx:dataProvider> <mx:columns> <mx:DataGridColumn headerText="Game Name" dataField="name"/> <mx:DataGridColumn headerText="Creator" dataField="creator"/> <mx:DataGridColumn headerText="Publisher" dataField="publisher"/> </mx:columns> </mx:DataGrid> <mx:Button id="mybutton" label="button" click="{test1()}" x="100" y="150"/> // working fine.. able to see the correct value of test </mx:Panel></mx:Application> Another file is calling the function test something like: <?xml version="1.0" encoding="utf-8"?><mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:local="*"> <mx:Script> <![CDATA[ public function test2():void { var tt:TestDataGrid = new TestDataGrid(); tt.test1(); } ]]> </mx:Script> <mx:Button id="mybutton" label="button" click="{test2()}" x="100" y="150"/> // This is returning null. How can i make this one to take the correct value </mx:Application>
Thanks,Vikrant --- On Mon, 1/6/09, Tom Chiverton <[email protected]> wrote: From: Tom Chiverton <[email protected]> Subject: Re: [flexcoders] Datagrid intialization problem? To: [email protected] Date: Monday, 1 June, 2009, 8:46 PM On Monday 01 Jun 2009, vikrant choudhary wrote: > Hi, I want to intialize the datagrid but looks like i am missing > something. Really, why ? Do you get an error or something ? The code you gave could have a number of problems, do you have a simple example that show the 'initialisation' problem and nothing else ? -- Helping to interactively build synergies as part of the IT team of the year, '09 and '08 Tom Chiverton Developer Tel: +44 0161 618 5032 Fax: +44 0161 618 5099 Tom.Chiverton@ halliwells. com 3 Hardman Square, Manchester, M3 3EB www.Halliwells. com ************ ********* ********* ********* ********* **** This email is sent for and on behalf of Halliwells LLP. Halliwells LLP is a limited liability partnership registered in England and Wales under registered number OC307980 whose registered office address is at Halliwells LLP, 3 Hardman Square, Spinningfields, Manchester, M3 3EB. A list of members is available for inspection at the registered office together with a list of those non members who are referred to as partners. We use the word ?partner? to refer to a member of the LLP, or an employee or consultant with equivalent standing and qualifications. Regulated by the Solicitors Regulation Authority. CONFIDENTIALITY This email is intended only for the use of the addressee named above and may be confidential or legally privileged. If you are not the addressee you must not read it and must not use any information contained in nor copy it nor inform any person other than Halliwells LLP or the addressee of its existence or contents. If you have received this email in error please delete it and notify Halliwells LLP IT Department on 0870 365 2500. For more information about Halliwells LLP visit www.Halliwells. com. Own a website.Get an unlimited package.Pay next to nothing.*Go to http://in.business.yahoo.com/

