Title: Flex 2.0: DataGrid.addChild - TypeError

Yeah, this is not how you get data into the DataGrid.  Just assign dataGrid.dataProvider = dataProvider and see if that will work for you.

 


From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Michel Bertrand
Sent: Wednesday, November 23, 2005 4:53 AM
To: [email protected]
Subject: [flexcoders] Flex 2.0: DataGrid.addChild - TypeError

 

Hello !

I've got "TypeError: Error #1034: Type Coersion failed: cannot convert [EMAIL PROTECTED] to flash.display.DisplayObject" in Flex 2.0.

I have the error using mx.controls.DataGrid in the following way:

                                var dataProvider:Array = new Array();
                               
                                var obj:Object = new Object();
                                obj.roleName = "Profile 1";
                                dataProvider[0] = obj;
                               
                                obj = new Object();
                                obj.roleName = "Profile 2";
                                dataProvider[1] = obj;

                                var column:DataGridColumn = new DataGridColumn();
                                column.columnName = "roleName";
                                column.headerText = "Avaible Profiles";
                                avaibleProfilesColumns[0] = column;

                                ...

                        if (dataProvider != null && dataProvider.length > 0) {
                                for (var i:int=0;i<dataProvider.length;i++){
                                        dataGrid.addChild(dataProvider[i]);
                                }
                        }

My "dataGrid" has all settings to handle data properly and it's shown all data, but it always produces the error above too.

Any idea to workaround this situation ? Has anybody faced it ?

Thanks in advance !
Michel.





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




YAHOO! GROUPS LINKS




Reply via email to