Thursday 15 July 2010

How to convert Array 2D to Array collection in Flex -


After

I have a 2D array as follows:

  Asia India Chennai Tamilnadu CATEGORY1 Products 1 100 Asia India Mumbai MH CATEGORY1 Products 1 100 Asia India Calcutta CT CATEGORY1 Products 1 100 Asia India Calcutta CT CATEGORY2 PRODUCT2 200 EMEA UK London LN CATEGORY3 Product 1 123 EMEA UK London LN CATEGORY3 PRODUCT2 455 EMEA UK Reading RN CATEGORY1 Product 1 500 EMEA UK Reading RN CATEGORY1 PRODUCT2 430   

How can I change the array to the 2D array above, so that I can use each data with different attributes like the first column "continent ", As the" country "etc. to indicate the attribute in the form of 2 columns. , ArrayCollection {: "Asia", country continent "India", ... etc} as the structure hasing and so on. How to get it dynamic

  private var a: array = new array ([100,200,300,40], [252,25,25,32]); Private var a1: array = new array (); [Bindable] private works ac: arreculsion = new array (); Private Function init (): For Zero {(Vertical I: Integer = 0; I & lt; a.length; i ++) {a1 [i] = For New Array () (upper j: integer = 0; J & lt; a [i] .length; j ++) {a1 [i] ["soft" + j] = a [i] [j]; }} Ac.source = a1; AC. Refresh () Alert Show (ac string ()); }    

No comments:

Post a Comment