Our blazing fast Grid component built with pure JavaScript


Post by thejas.pateel »

We are using dropdown and we want to use dynamic data in it. Such as initially the dropdown data will be blank and it should be disabled and after selecting a condition, api is being called and we are getting the data for the dropdown but we are not able to reflect it in the dropdown field.

For Example.
let say we have 3 dropdowns in a grid view i.e. Country, State and City as 3 different columns
After selecting the Country, API call should happen and the data of State should be populated and followed same as with City column

Attachments
Bryntum.jpg
Bryntum.jpg (24.92 KiB) Viewed 296 times

Post by tasnim »

Hi,
You can use https://bryntum.com/docs/grid/api/Grid/feature/CellEdit#event-beforeCellEditStart event.
beforeCellEditStart event has access to the record, In that event handler you can check what field is currently editing and load data to editor's combo.

Combo should have ajax store.
Here is an example of how you can load data from store https://bryntum.com/docs/grid/api/Core/widget/Combo#snippet-loading-data-from-store
AjaxStore https://bryntum.com/docs/grid/api/Core/widget/Combo#snippet-loading-data-from-store

And here is an example of how you can load remote data to cell editor combo https://bryntum.com/docs/grid/api/Grid/feature/CellEdit#loading-remote-data-into-a-combo-box-cell-editor

Good Luck :slightly_smiling_face:,
Tasnim


Post by thejas.pateel »

Hi Tasnim,
Thank you for the approach.The method works .
Regards Thejas


Post by tasnim »

Glad to hear that, All the best :slightly_smiling_face:


Post Reply