updating the dropdown list of the default column filter in ag-grid enterprise edition

I’m using AG-Grid enterprise edition (trail); and having an issue as in this stackoverflow post.

When the grid data is loaded, the values of one column are all empty. In an event handler, the column value on some rows will be set. The column filter is updated the first time column values are changed. From the second time on, the column filter dropdown list is not correct.

(The left side dropdown is when column values are changed for the first time, the right side is when the values are changed again after)

Here is my code:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>const onCreateBatchRequested = (rules: CreateMigrationBatchSchema) => {
if (gridApi) {
let [notPlannedUnitNodes, selectedUnitNodes] = selectPlanningItemsForBatch(gridApi, rules)
notPlannedUnitNodes.forEach((node) => {
if (node.data.planningState || node.data.plannedMigrationBatch) {
node.data.planningState = ItemState.NOT_PLANNED
node.data.plannedMigrationBatch = ""
node.updateData(node.data)
}
node.setSelected(false)
})
selectedUnitNodes.forEach((node) => {
node.data.planningState = ItemState.PLANNING
node.data.plannedMigrationBatch = rules.migrationBatchName
node.updateData(node.data)
node.setSelected(true)
})
}
}
</code>
<code>const onCreateBatchRequested = (rules: CreateMigrationBatchSchema) => { if (gridApi) { let [notPlannedUnitNodes, selectedUnitNodes] = selectPlanningItemsForBatch(gridApi, rules) notPlannedUnitNodes.forEach((node) => { if (node.data.planningState || node.data.plannedMigrationBatch) { node.data.planningState = ItemState.NOT_PLANNED node.data.plannedMigrationBatch = "" node.updateData(node.data) } node.setSelected(false) }) selectedUnitNodes.forEach((node) => { node.data.planningState = ItemState.PLANNING node.data.plannedMigrationBatch = rules.migrationBatchName node.updateData(node.data) node.setSelected(true) }) } } </code>
const onCreateBatchRequested = (rules: CreateMigrationBatchSchema) => {
    if (gridApi) {
        let [notPlannedUnitNodes, selectedUnitNodes] = selectPlanningItemsForBatch(gridApi, rules)
        notPlannedUnitNodes.forEach((node) => {
            if (node.data.planningState || node.data.plannedMigrationBatch) {
                node.data.planningState = ItemState.NOT_PLANNED
                node.data.plannedMigrationBatch = ""
                node.updateData(node.data)
            }
            node.setSelected(false)
        })
        selectedUnitNodes.forEach((node) => {
            node.data.planningState = ItemState.PLANNING
            node.data.plannedMigrationBatch = rules.migrationBatchName
            node.updateData(node.data)
            node.setSelected(true)
        })
    }
}

Tried adding

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>gridApi.applyTransaction({update: transaction})
or/and
gridApi.getColumnFilterInstance("...").refresh()
</code>
<code>gridApi.applyTransaction({update: transaction}) or/and gridApi.getColumnFilterInstance("...").refresh() </code>
gridApi.applyTransaction({update: transaction})
  or/and
gridApi.getColumnFilterInstance("...").refresh()

on top of the above code. The dropdown update seems to be ok, but I’d have to toggle the dropdown option to get the expected value displayed in the grid.

OK, I need 3 api calls to get the result I want:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>updatedRowNodes.forEach((node) => {node.updateData(node.data)})
gridApi.applyTransaction({update: updatedRowNodes})
gridApi.redrawRows({rowNodes: updatedRowNodes})
</code>
<code>updatedRowNodes.forEach((node) => {node.updateData(node.data)}) gridApi.applyTransaction({update: updatedRowNodes}) gridApi.redrawRows({rowNodes: updatedRowNodes}) </code>
updatedRowNodes.forEach((node) => {node.updateData(node.data)})
gridApi.applyTransaction({update: updatedRowNodes})
gridApi.redrawRows({rowNodes: updatedRowNodes})

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật