Re: [flexcoders] Splitting Array Content , keyword by field content
you can't use a for loop, maybe try a cursor instead What you cannot do is iterate through the properties of an object if it is an instance of a user-defined class, unless the class is a dynamic class. Even with instances of dynamic classes, you will be able to iterate only through properties that are added dynamically.-Flex Doc - Original Message From: Harry Saputra [EMAIL PROTECTED] To: flexcoders@yahoogroups.com Sent: Tuesday, February 12, 2008 10:33:44 PM Subject: RE: [flexcoders] Splitting Array Content , keyword by field content Check my code : arrJadwalPribadi = new ArrayCollection(event.result as Array); arrJadwalPribadi. refresh(); for (var item:Object in arrJadwalPribadi){ if (item.hari=='Senin') { senin.push(item); } else if (item.hari=='Selasa') { selasa.push(item); } …. I get ArrayCollection as Array from Weborb. When I try to this way, I get this error message : ReferenceError: Error #1069: Property hari not found on String and there is no default value. at siakad/::jadwalPribadiResult Handler() when I use variable arrJadwalPribadi on DataGrid, it’s working. I use property hari on labelField too. What’s wrong ? From: [EMAIL PROTECTED] ups.com [mailto:flexcoders@ yahoogroups. com] On Behalf Of Gordon Smith Sent: Wednesday, February 13, 2008 10:42 AM To: [EMAIL PROTECTED] ups.com Subject: RE: [flexcoders] Splitting Array Content , keyword by field content You shouldn't assume that a for-in or for-each-in loop will iterate over the items in any particular order. To ensure this, use a plain 'for' loop. Gordon Smith Adobe Flex SDK Team Looking for last minute shopping deals? Find them fast with Yahoo! Search. http://tools.search.yahoo.com/newsearch/category.php?category=shopping
RE: [flexcoders] Splitting Array Content , keyword by field content
Or may I content filter in DataGrid ( all item I shown in datagrid ) and filtering when columnA constraint 'xxx' value ? How ? From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Sherif Abdou Sent: Wednesday, February 13, 2008 11:46 AM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Splitting Array Content , keyword by field content you can't use a for loop, maybe try a cursor instead What you cannot do is iterate through the properties of an object if it is an instance of a user-defined class, unless the class is a dynamic class. Even with instances of dynamic classes, you will be able to iterate only through properties that are added dynamically.-Flex Doc - Original Message From: Harry Saputra [EMAIL PROTECTED] To: flexcoders@yahoogroups.com Sent: Tuesday, February 12, 2008 10:33:44 PM Subject: RE: [flexcoders] Splitting Array Content , keyword by field content Check my code : arrJadwalPribadi = new ArrayCollection(event.result as Array); arrJadwalPribadi. refresh(); for (var item:Object in arrJadwalPribadi){ if (item.hari=='Senin') { senin.push(item); } else if (item.hari=='Selasa') { selasa.push(item); } .. I get ArrayCollection as Array from Weborb. When I try to this way, I get this error message : ReferenceError: Error #1069: Property hari not found on String and there is no default value. at siakad/::jadwalPribadiResult Handler() when I use variable arrJadwalPribadi on DataGrid, it's working. I use property hari on labelField too. What's wrong ? From: [EMAIL PROTECTED] ups.com http://ups.com/ [mailto:flexcoders@ yahoogroups. com] On Behalf Of Gordon Smith Sent: Wednesday, February 13, 2008 10:42 AM To: [EMAIL PROTECTED] ups.com http://ups.com/ Subject: RE: [flexcoders] Splitting Array Content , keyword by field content You shouldn't assume that a for-in or for-each-in loop will iterate over the items in any particular order. To ensure this, use a plain 'for' loop. Gordon Smith Adobe Flex SDK Team _ Looking for last minute shopping deals? Find http://us.rd.yahoo.com/evt=51734/*http:/tools.search.yahoo.com/newsearch/ca tegory.php?category=shopping them fast with Yahoo! Search. image001.jpgimage002.jpg
RE: [flexcoders] Splitting Array Content , keyword by field content
Check my code : arrJadwalPribadi = new ArrayCollection(event.result as Array); arrJadwalPribadi.refresh(); for (var item:Object in arrJadwalPribadi){ if (item.hari=='Senin') { senin.push(item); } else if (item.hari=='Selasa') { selasa.push(item); } .. I get ArrayCollection as Array from Weborb. When I try to this way, I get this error message : ReferenceError: Error #1069: Property hari not found on String and there is no default value. at siakad/::jadwalPribadiResultHandler() when I use variable arrJadwalPribadi on DataGrid, it's working. I use property hari on labelField too. What's wrong ? From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Gordon Smith Sent: Wednesday, February 13, 2008 10:42 AM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Splitting Array Content , keyword by field content You shouldn't assume that a for-in or for-each-in loop will iterate over the items in any particular order. To ensure this, use a plain 'for' loop. Gordon Smith Adobe Flex SDK Team
RE: [flexcoders] Splitting Array Content , keyword by field content
You shouldn't assume that a for-in or for-each-in loop will iterate over the items in any particular order. To ensure this, use a plain 'for' loop. Gordon Smith Adobe Flex SDK Team From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Harry Saputra Sent: Tuesday, February 12, 2008 6:57 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Splitting Array Content , keyword by field content Thanks for reply ! I will try ASAP. And the last, how to get a auto fit / resize (by content length) DataGrid Column width , so I can build a nice DataGrid. Thanks a lot :-) From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Sherif Abdou Sent: Wednesday, February 13, 2008 9:50 AM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Splitting Array Content , keyword by field content like this? ?xml version=1.0 encoding=utf-8? mx:WindowedApplication xmlns:mx=http://www.adobe.com/2006/mxml; layout=vertical creationComplete=initApp() xmlns:containers=flexlib.containers.* mx:Style source=styles.css/ mx:Script ![CDATA[ import mx.collections.IViewCursor; import mx.collections.ArrayCollection; [Bindable] private var myArrayCollection:ArrayCollection = new ArrayCollection([{Letter:'A',Name:Andi}, {Letter:'A',Name:Ash}, {Letter:'A',Name:Axe}, {Letter:'B',Name:Bart}, {Letter:'B',Name:Boe}, ]); private function initApp():void{ var arrAData:Array = []; var arrBData:Array = []; for each(var item:Object in myArrayCollection){ if(item.Letter==A){ arrAData.push(item); }else{ arrBData.push(item); } } } ]] /mx:Script - Original Message From: Harry Saputra [EMAIL PROTECTED] To: flexcoders@yahoogroups.com Sent: Tuesday, February 12, 2008 8:37:39 PM Subject: [flexcoders] Splitting Array Content , keyword by field content Dear All, I have DataProvider as Array like this : A Andi A Ash A Axe B Bart B Bob Called arrMainData. Can I split it into 2 variable Array when I complete retrieve all Data ? like this : arrAData A Andi A Ash A Axe arrBData B Bart B Bob Thanks :-) Looking for last minute shopping deals? Find them fast with Yahoo! Search. http://us.rd.yahoo.com/evt=51734/*http:/tools.search.yahoo.com/newsearc h/category.php?category=shopping
Re: [flexcoders] Splitting Array Content , keyword by field content
like this? ?xml version=1.0 encoding=utf-8? mx:WindowedApplication xmlns:mx=http://www.adobe.com/2006/mxml; layout=vertical creationComplete=initApp() xmlns:containers=flexlib.containers.* mx:Style source=styles.css/ mx:Script ![CDATA[ import mx.collections.IViewCursor; import mx.collections.ArrayCollection; [Bindable] private var myArrayCollection:ArrayCollection = new ArrayCollection([{Letter:'A',Name:Andi}, {Letter:'A',Name:Ash}, {Letter:'A',Name:Axe}, {Letter:'B',Name:Bart}, {Letter:'B',Name:Boe}, ]); private function initApp():void{ var arrAData:Array = []; var arrBData:Array = []; for each(var item:Object in myArrayCollection){ if(item.Letter==A){ arrAData.push(item); }else{ arrBData.push(item); } } } ]] /mx:Script - Original Message From: Harry Saputra [EMAIL PROTECTED] To: flexcoders@yahoogroups.com Sent: Tuesday, February 12, 2008 8:37:39 PM Subject: [flexcoders] Splitting Array Content , keyword by field content Dear All, I have DataProvider as Array like this : AAndi AAsh AAxe BBart BBob Called arrMainData. Can I split it into 2 variable Array when I complete retrieve all Data ? like this : arrAData AAndi AAsh AAxe arrBData BBart BBob Thanks J Looking for last minute shopping deals? Find them fast with Yahoo! Search. http://tools.search.yahoo.com/newsearch/category.php?category=shopping
RE: [flexcoders] Splitting Array Content , keyword by field content
Max 20 record. Not big. May I ? When try to manipulate data on server side, I must create a more function ( service ) and on my flex I must create more remoteObject method. It's not good :-) Thanks.. From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Sherif Abdou Sent: Wednesday, February 13, 2008 12:07 PM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Splitting Array Content , keyword by field content why not do that stuff server side and just bring it in to flex for use. I have no idea how big your data will be but that could be a better stradegy than trying to iterate. how many groups do you have - Original Message From: Harry Saputra [EMAIL PROTECTED] To: flexcoders@yahoogroups.com Sent: Tuesday, February 12, 2008 10:56:32 PM Subject: RE: [flexcoders] Splitting Array Content , keyword by field content Or may I content filter in DataGrid ( all item I shown in datagrid ) and filtering when columnA constraint 'xxx' value ? How ? From: [EMAIL PROTECTED] ups.com http://ups.com/ [mailto:flexcoders@ yahoogroups. com] On Behalf Of Sherif Abdou Sent: Wednesday, February 13, 2008 11:46 AM To: [EMAIL PROTECTED] ups.com http://ups.com/ Subject: Re: [flexcoders] Splitting Array Content , keyword by field content you can't use a for loop, maybe try a cursor instead What you cannot do is iterate through the properties of an object if it is an instance of a user-defined class, unless the class is a dynamic class. Even with instances of dynamic classes, you will be able to iterate only through properties that are added dynamically.-Flex Doc - Original Message From: Harry Saputra [EMAIL PROTECTED] com To: [EMAIL PROTECTED] ups.com http://ups.com/ Sent: Tuesday, February 12, 2008 10:33:44 PM Subject: RE: [flexcoders] Splitting Array Content , keyword by field content Check my code : arrJadwalPribadi = new ArrayCollection(event.result as Array); arrJadwalPribadi. refresh(); for (var item:Object in arrJadwalPribadi){ if (item.hari=='Senin') { senin.push(item); } else if (item.hari=='Selasa') { selasa.push(item); } .. I get ArrayCollection as Array from Weborb. When I try to this way, I get this error message : ReferenceError: Error #1069: Property hari not found on String and there is no default value. at siakad/::jadwalPribadiResult Handler() when I use variable arrJadwalPribadi on DataGrid, it's working. I use property hari on labelField too. What's wrong ? From: [EMAIL PROTECTED] ups.com http://ups.com/ [mailto:flexcoders@ yahoogroups. com] On Behalf Of Gordon Smith Sent: Wednesday, February 13, 2008 10:42 AM To: [EMAIL PROTECTED] ups.com http://ups.com/ Subject: RE: [flexcoders] Splitting Array Content , keyword by field content You shouldn't assume that a for-in or for-each-in loop will iterate over the items in any particular order. To ensure this, use a plain 'for' loop. Gordon Smith Adobe Flex SDK Team _ Looking for last minute shopping deals? Find them fast with Yahoo! Search. http://us.rd.yahoo.com/evt=51734/*http:/tools.search.yahoo.com/newsearch/ca tegory.php?category=shopping _ Never miss a thing. Make Yahoo http://us.rd.yahoo.com/evt=51438/*http:/www.yahoo.com/r/hs your homepage. image001.jpgimage002.jpg
Re: [flexcoders] Splitting Array Content , keyword by field content
why not do that stuff server side and just bring it in to flex for use. I have no idea how big your data will be but that could be a better stradegy than trying to iterate. how many groups do you have - Original Message From: Harry Saputra [EMAIL PROTECTED] To: flexcoders@yahoogroups.com Sent: Tuesday, February 12, 2008 10:56:32 PM Subject: RE: [flexcoders] Splitting Array Content , keyword by field content Or may I content filter in DataGrid ( all item I shown in datagrid ) and filtering when columnA constraint ‘xxx’ value ? How ? From: [EMAIL PROTECTED] ups.com [mailto:flexcoders@ yahoogroups. com] On Behalf Of Sherif Abdou Sent: Wednesday, February 13, 2008 11:46 AM To: [EMAIL PROTECTED] ups.com Subject: Re: [flexcoders] Splitting Array Content , keyword by field content you can't use a for loop, maybe try a cursor instead What you cannot do is iterate through the properties of an object if it is an instance of a user-defined class, unless the class is a dynamic class. Even with instances of dynamic classes, you will be able to iterate only through properties that are added dynamically.-Flex Doc - Original Message From: Harry Saputra [EMAIL PROTECTED] com To: [EMAIL PROTECTED] ups.com Sent: Tuesday, February 12, 2008 10:33:44 PM Subject: RE: [flexcoders] Splitting Array Content , keyword by field content Check my code : arrJadwalPribadi = new ArrayCollection(event.result as Array); arrJadwalPribadi. refresh(); for (var item:Object in arrJadwalPribadi){ if (item.hari=='Senin') { senin.push(item); } else if (item.hari=='Selasa') { selasa.push(item); } …. I get ArrayCollection as Array from Weborb. When I try to this way, I get this error message : ReferenceError: Error #1069: Property hari not found on String and there is no default value. at siakad/::jadwalPribadiResult Handler() when I use variable arrJadwalPribadi on DataGrid, it’s working. I use property hari on labelField too. What’s wrong ? From: [EMAIL PROTECTED] ups.com [mailto:flexcoders@ yahoogroups. com] On Behalf Of Gordon Smith Sent: Wednesday, February 13, 2008 10:42 AM To: [EMAIL PROTECTED] ups.com Subject: RE: [flexcoders] Splitting Array Content , keyword by field content You shouldn't assume that a for-in or for-each-in loop will iterate over the items in any particular order. To ensure this, use a plain 'for' loop. Gordon Smith Adobe Flex SDK Team Looking for last minute shopping deals? Find them fast with Yahoo! Search. Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
RE: [flexcoders] Splitting Array Content , keyword by field content
Thanks for reply ! I will try ASAP. And the last, how to get a auto fit / resize (by content length) DataGrid Column width , so I can build a nice DataGrid. Thanks a lot :-) From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Sherif Abdou Sent: Wednesday, February 13, 2008 9:50 AM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Splitting Array Content , keyword by field content like this? ?xml version=1.0 encoding=utf-8? mx:WindowedApplication xmlns:mx=http://www.adobe.com/2006/mxml; layout=vertical creationComplete=initApp() xmlns:containers=flexlib.containers.* mx:Style source=styles.css/ mx:Script ![CDATA[ import mx.collections.IViewCursor; import mx.collections.ArrayCollection; [Bindable] private var myArrayCollection:ArrayCollection = new ArrayCollection([{Letter:'A',Name:Andi}, {Letter:'A',Name:Ash}, {Letter:'A',Name:Axe}, {Letter:'B',Name:Bart}, {Letter:'B',Name:Boe}, ]); private function initApp():void{ var arrAData:Array = []; var arrBData:Array = []; for each(var item:Object in myArrayCollection){ if(item.Letter==A){ arrAData.push(item); }else{ arrBData.push(item); } } } ]] /mx:Script - Original Message From: Harry Saputra [EMAIL PROTECTED] To: flexcoders@yahoogroups.com Sent: Tuesday, February 12, 2008 8:37:39 PM Subject: [flexcoders] Splitting Array Content , keyword by field content Dear All, I have DataProvider as Array like this : A Andi A Ash A Axe B Bart B Bob Called arrMainData. Can I split it into 2 variable Array when I complete retrieve all Data ? like this : arrAData A Andi A Ash A Axe arrBData B Bart B Bob Thanks :-) _ Looking for last minute shopping deals? Find http://us.rd.yahoo.com/evt=51734/*http:/tools.search.yahoo.com/newsearch/ca tegory.php?category=shopping them fast with Yahoo! Search. image001.jpgimage002.jpg