フォーマット付きのRecordGrid入力について

【ご質問】
カンマ区切りで表示しているセルに対して、値を変更させても初期値に戻ってしまいます。
カンマが付加された状態で、値の変更を行うことは可能でしょうか。

【回答】
RecordGridのローカルオプション”parse-spec”を使用し、値の設定を行うことで実現可能です。

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

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

{import * from CURL.LANGUAGE.FORMAT}

{let sample:RecordSet =
    {RecordSet
        {RecordFields
            {RecordField “Month”, domain = String},
            {RecordField “Sum”, domain = double}
        },
        {RecordData Month = “April”, Sum = 100},
        {RecordData Month = “May”, Sum = 101212},
        {RecordData Month = “June”, Sum = 1522}
    }
}

{let rg:RecordGrid =
    {RecordGrid
        record-source = sample,
        height = 5cm,
        automatic-columns? = false,
        {RecordGridColumn “Month”},
        {RecordGridColumn
            “Sum”,
            format-spec =
                {proc {data:any, r:Record}:String
                    let number-format:NumberFormatter = {NumberFormatter}
                    set number-format.use-grouping? = true
                    set number-format.grouping-size  = 3
                    set number-format.grouping-separator = “,”
                    {return {number-format.format data}}
                },
            parse-spec  = {proc {data:String}:any
                                   {if data != “” then
                                     {try
                                         let number-parser:NumberParser =
                                             {NumberParser allow-grouping? = true}
                                     
                                         set data = {String {number-parser.parse-int64 data}}
                                     
                                      catch e:Exception do
                                         set data = “”
                                     }
                                  }
                                 {return data}
                               }
        }
    }
}

{value rg}

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