我有一些 JSON 数据正在使用http://reb4.me/r/altjson转换为 Rebol 块,看起来像这样:
jobs_data: make object! [
sections: [
make object! [
id: "1"
title: "Section Title 1"
jobs: [
make object! [
id: "101"
title: "Job Title 1"
description: {Job description one.}
]
]
]
make object! [
id: "2"
title: "Section Title 2"
jobs: [
make object! [
id: "201"
title: "Job Title 2"
description: {Job description two.}
]
make object! [
id: "202"
title: "Job Title 3"
description: {Job description three.}
]
]
]
]
]
我正在通过执行以下操作填充一个包含所有部分标题的文本列表:
text-list data (map-each section jobs_data/sections [section/title])
我在那个下面还有一个空白文本列表。我想用所选部分的职务填充第二个文本列表。我该怎么做呢?我试过这样的事情:
REBOL []
do http://reb4.me/r/altjson
jobs_data: load-json %./jobs.json
view layout [
sections: text-list data (map-each section jobs_data/sections [section/title]) [
; How do I get the jobs of the given section?
]
jobs: text-list
]