フォーム データを JSON オブジェクトにシリアル化しようとしていますが、カートオブジェクトを作成する必要があるときに行き詰まります。
フォーム内のすべてのデータを取得した後に達成したいのは、以下のスニペットのようなオブジェクトです。これどうやってするの?
したがって、ここで完全なコードを確認してテストできますhttp://jsbin.com/OyAzAZA/3/
{
"client_id": 1,
"carts": [
{
"cart_id": 1,
"items": [
{
"code": "01",
"descrption": "text 1"
},
{
"code": "02",
"descrption": "text 2"
}
]
},
{
"cart_id": 2,
"items": [
{
"code": "03",
"descrption": "text 3"
},
{
"code": "04",
"descrption": "text 4"
}
]
}
]
}