Filling comboboxes INSIDE datagrid with UNIQUE data IN actionscript (flex)

I searched for several hours and did not find an answer to my problem.

I am trying to place comboboxes in a datagrid populated with DYNAMIC data. (the number and contents of these lists always change. I don’t know in advance how many columns there are, where I need to use comboboxes, so each individual list box gets a unique dataprovider, which comes from an external source, WHEN the program works.)

-i found MANY topics that discuss this problem, but are solved using crappy mxml files, filling in the combo boxes inside the source code manually. I want to point out that this is not good for me.

-i found a better solution in which they used some sort of custom itemrenderer to retrieve data from the internet. (a kind of strange thing), but, unfortunately, it was not enough, because the number and name of countries in the world are more or less static, they do not change. therefore, their visualization class did not depend on any parameters on the main algorithm.

but in my program, I compute the data in my own actionscript objects and then populate it with an arraylist. so at the beginning I download the necessary data from the network, and when I get the urlrequest response, AFTER I start populating the datagrid / combobox.

I can fill any datagrid or combobox without any problems, but it seems impossible to put this combobox inside the datagrid cell.

- ? . , #, java, php + html, flex , .

EDIT: , . , , , . :

( , )

=========

main.mxml

, datagrids. (: maxwidth, maxheight, ..) , , actionscript, , datagrid.

"..<fx:Script>
    <![CDATA[
        private var myGrid1:MyGridType;
        ..
        somefunction {
            myGrid1 = new MyGridType(theDatagridDefinedBefore, "argumentNeededToFillDataGridsWithUniqueData");
        }
    ]]>
</fx:Script>.."

=========

MyGridType.as

urlrequest , eventlistener. , eventlistener filler: arraycollection, dataprovider datagrid .

.

comboboxes. combobox. "MyComboBoxType".

"..
blablabla = new MyComboBoxType(theDatagridDefinedBefore, param1, param2, param3);"

=========

MyComboBoxType.as

, MyGridType. 1-2. , arraycollection. , arraycollection combobox. AAAAAAAND , arraycollection combobox datagrid "theDatagridDefinedBefore".

+3
2

, , , . ComboBox DataGrid, , .

, ArrayCollection, datagrid, .

0

[Bindable] - MyGridData class - ( );

  • dataProvider Array / ArrayCollection /.. MyGridData.
  • , : getItemEditor mxml, .
  • dataProvider combobox, data.comboArray , MyGridData, . ( set data(value: Object):void , .)
  • , , / - .
0

Source: https://habr.com/ru/post/1786812/


All Articles