特定の列に richSelect ドロップダウンが使用されている ag-grid リーチ ベースのアプリケーションがあります。一部の richSelect 列では、ドロップダウンの値は ID に基づく必要があります。
私の JSON データは次のようになります。
data : [{
collegeId : "MIT",
users : [{
name : "Alex",
country : "USA"
}, {
name : "Barbara",
country : "Canada"
}
]
}, {
collegeId : "Berkeley",
users : [{
name : "Samantha",
country : "Australia"
}, {
name : "Amanda",
country : "Germany"
}
]
}
]
私のcolDefsは次のようになります。
{ headerName : "Users", field: "users", filter: "text",
cellEditor : "richSelect",
cellEditorParams : {
values : this.getValues()
}
}
問題は、MIT の行で、ユーザー リストに Alex と Barbara のみを含めることです。同様に、Berkeley の場合、Samantha と Amanda のみを含めるには User の richSelect が必要です。
ここでユーザーリストはcollegeIdに依存します。getValues() では、すべてのユーザーを取得できますが、collegeId の一致に基づいて取得する方法がわかりません。