clever-oil-61353
06/28/2020, 7:11 AMbright-gpu-74537
06/28/2020, 7:14 AMclever-oil-61353
06/28/2020, 7:15 AMbright-gpu-74537
06/28/2020, 7:16 AMxml
<item-renderer>
<vbox>
<image id="theImage" />
<hbox>
<label id="theLabel1" />
<label id="theLabel2" />
</hbox>
</vbox>
</item-renderer>
bright-gpu-74537
06/28/2020, 7:17 AMmyListView.dataSource.add({ theImage: "someimage", theLabel1: "item 1A", theLabel2: "item 1B"});
myListView.dataSource.add({ theImage: "someimage", theLabel1: "item 2A", theLabel2: "item 2B"});
myListView.dataSource.add({ theImage: "someimage", theLabel1: "item 3A", theLabel2: "item 3B"});
bright-gpu-74537
06/28/2020, 8:01 AMbright-gpu-74537
06/28/2020, 8:01 AMbright-gpu-74537
06/28/2020, 9:49 AMfast-rain-20339
06/28/2020, 9:54 AMbright-gpu-74537
06/28/2020, 9:55 AMbright-gpu-74537
06/28/2020, 9:55 AMcool-psychiatrist-49311
06/28/2020, 2:21 PMhaxe
var data = // ... current entry in dataSource
var renderer // ... current item renderer
var c = renderer.findComponentById('theImage');
c.data = data.theImage;
cool-psychiatrist-49311
06/28/2020, 2:24 PMhaxe
var dataSource:DataSource<MyData> = // ...
var list = new List();
list.dataSource = dataSource;
list.renderItem = function(data:MyData, ?cached:Component):Component { /* ... */ }
bright-gpu-74537
06/28/2020, 2:43 PMpublic var itemRendererFunction(get, set):ItemRendererFunction2;
but it returns a class not a component instance so that class will still have to end up being an item rendererbright-gpu-74537
06/28/2020, 2:43 PMbright-gpu-74537
06/28/2020, 2:45 PMcool-psychiatrist-49311
06/28/2020, 2:47 PMdata
field of a component defined?cool-psychiatrist-49311
06/28/2020, 2:48 PM.text
for Label`bright-gpu-74537
06/28/2020, 2:49 PMcool-psychiatrist-49311
06/28/2020, 2:49 PM@:value(text)
cool-psychiatrist-49311
06/28/2020, 2:49 PMbright-gpu-74537
06/28/2020, 2:49 PMcool-psychiatrist-49311
06/28/2020, 2:50 PMbright-gpu-74537
06/28/2020, 2:51 PMlist.renderItem = function(data:MyData, ?cached:Component):Component { /* ... */ }
might be something interesting to explore anyway thoughbright-gpu-74537
06/28/2020, 2:51 PMcool-psychiatrist-49311
06/28/2020, 2:53 PMrenderItem:Data->ReactElement
but ReactElement is just data in the virtual DOM
the actual "real" element is created/modified by the reconciler
so it might be trickier for haxeui because it has to render the real component directlycool-psychiatrist-49311
06/28/2020, 2:54 PMbright-gpu-74537
06/28/2020, 2:55 PMcool-psychiatrist-49311
06/28/2020, 2:56 PMcool-psychiatrist-49311
06/28/2020, 2:56 PM