RecordGridのソート解除

【ご質問】
RecordGridの列見出しをクリックすると、その列の定義に応じてソートされる機能が
標準で搭載されていますが、このソートを解除する機能はあるのでしょうか。

【回答】
一度設定されたRecordGridのソートを解除するには、
RecordGrid.sortの設定をnullに設定した後リロードすることで実現可能です。

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

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

{let people:RecordSet =
    {RecordSet
        {RecordFields
            {RecordField “First”, domain = String},
            {RecordField “Last”, domain = String},
            {RecordField “Age”, domain = int}
        },
        {RecordData First = “John”, Last = “Smith”, Age = 25},
        {RecordData First = “Jane”, Last = “Smith”, Age = 1},
        {RecordData First = “John”, Last = “Smith”, Age = 2},
        {RecordData First = “Jane”, Last = “Smith”, Age = 3},
        {RecordData First = “John”, Last = “Smith”, Age = 4},
        {RecordData First = “Jane”, Last = “Smith”, Age = 5},
        {RecordData First = “John”, Last = “Smith”, Age = 6},
        {RecordData First = “Jane”, Last = “Smith”, Age = 7},
        {RecordData First = “John”, Last = “Smith”, Age = 8},
        {RecordData First = “Jane”, Last = “Smith”, Age = 29},
        {RecordData First = “John”, Last = “Smith”, Age = 225},
        {RecordData First = “Jane”, Last = “Smith”, Age = 293},
        {RecordData First = “John”, Last = “Smith”, Age = 2},
        {RecordData First = “Jane”, Last = “Smith”, Age = 39},
        {RecordData First = “John”, Last = “Smith”, Age = 55},
        {RecordData First = “Jane”, Last = “Smith”, Age = 21},
        {RecordData First = “John”, Last = “Smith”, Age = 6},
        {RecordData First = “Jane”, Last = “Smith”, Age = 229},
        {RecordData First = “John”, Last = “Smith”, Age = 45},
        {RecordData First = “Jane”, Last = “Smith”, Age = 222},
        {RecordData First = “Jane”, Last = “Jones”, Age = 288}
    }
}

{let rg:RecordGrid =
    {RecordGrid
        record-source = people,
        width = 10.5cm,
        height = 10cm,
        column-selection-enabled? = true,
        multiple-selection-enabled? = false,
        display-filler-column? = true,
        record-selection-enabled? = false
    }
}

{value
    {VBox
        {CommandButton label = “並びを戻す”,
            {on Action do
                set rg.sort = null
                {rg.reload}
            }
        },
        rg
    }
}