Thread Rating:
  • 291 Vote(s) - 2.84 Average
  • 1
  • 2
  • 3
  • 4
  • 5
レコードグリッドの行番号を表示するには?
08-20-2013, 04:20 PM,
#2
RE: レコードグリッドの行番号
RecordGrid.row-background-spec を利用する方法があると思いますが、
そもそも行番号のためのプロパティではないですし、
並び替えのたびに、すべてのレコードが編集されてしまうのがうれしくありません。

中のレコードとは関係なく行番号を表示することはできないのでしょうか。

Code:
{define-proc public {notified rg:RecordGrid, r:Record, i:int}:#Background
    set r["id"] = {String i + 1}
    {return null}
}

{let people:RecordSet =
    {RecordSet
        {RecordFields
            {RecordField "id", domain = String},
            {RecordField "First", domain = String},
            {RecordField "Last", domain = String},
            {RecordField "Age", domain = int}
        },
        {RecordData id = "1", First = "John", Last = "Smith", Age = 25},
        {RecordData id = "1", First = "Jane", Last = "Smith", Age = 29},
        {RecordData id = "1", First = "Jane", Last = "Jones", Age = 28}
    }
}
{def rg =
    {RecordGrid
        row-background-spec = notified,
        record-source = people,
        height = 5cm,
        width = 8in,
        vertical-grid-line-width = 4px
    }
}

{value
    {VBox
        rg,
        {HBox
            {CommandButton
                width = {make-elastic}, label = "append record",
                {on Action do
                    {people.append {RecordData}}
                }
            },
            {CommandButton
                width = {make-elastic}, label = "delete current record",
                {on Action do
                    {if-non-null r = rg.current-record then
                        {r.delete}
                    }
                }
            },
            {CommandButton
                width = {make-elastic}, label = "commit records",
                bound-command = {rg.get-command "commit"}
            },
            {CommandButton
                width = {make-elastic}, label = "revert records",
                bound-command = {rg.get-command "revert"}
            }
        }
    }
}



Messages In This Thread
RE: レコードグリッドの行番号 - by umemura - 08-20-2013, 04:20 PM
Forum Jump:


Users browsing this thread:
1 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('957')