2

I have UI in XML format:

<HBox layout:Column-cols="[-1,140,100,100,60,120,100,-1]">
    <Widget />
    <Text name="'name1'" text="'img.png'" />
    <Text name="'good1'" text="'1'" />
    <Text name="'bad1'" text="'9'" />
    <Text name="'all1'" text="'10'" />
    <Text name="'average1'" text="'0.980'" />
    <Button name="'response1'" text="'Посмотреть'" defaults="'TableButton'" />
    <Widget />
</HBox>

I tried to create a dynamic structure but there was a problem in the job argument with columns from the parent and functions by pressing the button. How it is implemented in stablex? (P.S xml structure works about like a demo interface example).

In Haxe code I did like this:

var logpage:VBox  = cast UIBuilder.get('logpage');
var cols:Array<Int> = [ -1, 140, 100, 100, 60, 120, 100, -1];
var Rowlog = UIBuilder.create(HBox, {
    //cast(Rowlog.layout, Column).cols  = cols, 
    children : [
        UIBuilder.create(Widget, {}),
        UIBuilder.create(Text, {
            text : json.image,
            name : 'name'+num
        }),
        UIBuilder.create(Text, {
            text : json.good_response,
            name : 'good'+num
        }),
        UIBuilder.create(Text, {
            text : json.bad_response,
            name : 'bad'+num
        }),
        UIBuilder.create(Text, {
            text : json.response_count,
            name : 'count'+num
        }),
        UIBuilder.create(Text, {
            text : json.response_time,
            name : 'time'+num
        }),
        UIBuilder.create(Button, {
            text : 'Посмотреть',
            name : '',
            defaults : 'TableButton'
            //on-click : goDownloadLog();
        }),
        UIBuilder.create(Widget, {})
    ]
});
logpage.addChild(Rowlog);
Sam Twidale
  • 1,123
  • 19
  • 16
  • 31

0 Answers0