Thread Rating:
  • 306 Vote(s) - 2.72 Average
  • 1
  • 2
  • 3
  • 4
  • 5
同名RecordGridを何度も生成したときの挙動
10-22-2015, 12:50 PM,
#3
RE: 同名RecordGridを何度も生成したときの挙動
実現したかったことはこんな感じでしょうか?

Code:
{curl 8.0 applet}

{def rg = {RecordGrid}}

{define-proc {set-columns-and-fields
                 rg:RecordGrid,
                 first-time?:bool = false
             }:void
    let fields:{Array-of RecordField} = {new {Array-of RecordField}}
    let rgc:{Array-of RecordGridColumn} = {new {Array-of RecordGridColumn}}
    
    {if first-time? then
        {rgc.append {RecordGridColumn "row-header"}}
        {rgc.append {RecordGridColumn "detail-amount-1"}}
        {rgc.append {RecordGridColumn "detail-amount-2"}}
        {rgc.append {RecordGridColumn "detail-amount-3"}}
        {fields.append {RecordField "row-header", caption = "", domain = String}}
        {fields.append {RecordField "detail-amount-1",caption= "初回1"}}
        {fields.append {RecordField "detail-amount-2",caption= "初回2"}}
        {fields.append {RecordField "detail-amount-3",caption= "初回3"}}
     else
        {rgc.append {RecordGridColumn "row-header"}}
        {rgc.append {RecordGridColumn "detail-amount-1"}}
        {rgc.append {RecordGridColumn "detail-amount-2"}}
        {rgc.append {RecordGridColumn "detail-amount-3"}}
        {rgc.append {RecordGridColumn "detail-amount-4"}}
        {fields.append {RecordField "row-header", caption = "", domain = String}}
        {fields.append {RecordField "detail-amount-1",caption= "2回目1"}}
        {fields.append {RecordField "detail-amount-2",caption= "2回目2"}}
        {fields.append {RecordField "detail-amount-3",caption= "2回目3"}}
        {fields.append {RecordField "detail-amount-4",caption= "2回目4"}}
    }
    
    set rg.columns = rgc
    set rg.record-source = {RecordSet {RecordFields {splice fields}}}
}

{value
    {VBox
        rg,
        {CommandButton
            label = "1回目",
            {on Action do
                {set-columns-and-fields
                    rg,
                    first-time? = true
                }
            }
        },
        {CommandButton
            label = "2回目",
            {on Action do
                {set-columns-and-fields
                    rg,
                    first-time? = false
                }
            }
        }
    }
}


Messages In This Thread
RE: 同名RecordGridを何度も生成したときの挙動 - by dyoshida - 10-22-2015, 12:50 PM
Forum Jump:


Users browsing this thread:
2 Guest(s)

MyBB SQL Error

MyBB has experienced an internal SQL error and cannot continue.

SQL Error:
1017 - Can't find file: 'mybb_threadviews' (errno: 2)
Query:
INSERT INTO mybb_threadviews (tid) VALUES('1270')