RecordGridのソート制御

【ご質問】
RecordGridにて、ソートを無効にするにはどうしたらよいか。

【回答】
RecordGrid.sort-spec (オプション)をnullに設定することで、
ソートが実行されないようにすることができます。

詳細は以下のサンプルをご参照ください。

{curl 6.0,7.0,8.0 applet}
{curl-file-attributes character-encoding = “shift-jis”}

{let records:RecordSet =
    {RecordSet
        {RecordFields
            {RecordField
                “id”, caption = “User ID”, domain = int,
                index-type = RecordFieldIndexType.unique
            },
            {RecordField “Last”, domain = String},
            {RecordField “First”, domain = String},
            {RecordField “City”, domain = String}

        },
        {RecordData id = 1, Last = “Smith”, First = “Gene”, City = “Boston”},
        {RecordData id = 2, Last = “Smith”, First = “Fred”, City = “Cambridge”},
        {RecordData id = 3, Last = “Smith”, First = “Mike”, City = “Keene”},
        {RecordData id = 4, Last = “Smith”, First = “Ben”, City = “New Haven”},
        {RecordData id = 5, Last = “Abrams”, First = “Ben”, City = “Boston”},
        {RecordData id = 6, Last = “Jones”, First = “Sam”, City = “Storrs”},
        {RecordData id = 7, Last = “Stevens”, First = “Nigel”, City = “Hartford”},
        {RecordData id = 8, Last = “Stevens”, First = “Bert”, City = “Cambridge”},
        {RecordData id = 9, Last = “Linden”, First = “Pat”, City = “Hartford”},
        {RecordData id = 10, Last = “Abrams”, First = “Mat”, City = “Boston”}
    }
}

{View
    {RecordGrid
        record-source = records,
        height = 10cm,
        width = 13cm,
        sort-spec = null
    },
    visibility = “normal”,
    {on WindowClose do
        {exit}
    }
}

また、APIリファレンスの
[CURL.GUI.CONTROL-LOGICAL]-[RecordGridOptions]
の項内のプロパティ[sort-spec]の項をご参照ください。