Premium support for our pure JavaScript UI components


Post by jandresampaio »

Hi,

Some of our grid columns have a combo editor, for which the datasource is resolved after making an http request.
We tried to update the items on the combo by setting

 editor.store.loadData(newData) 

or

editor.items = newData 

but with no success.

What is the correct way to change the data and make it appear on the editor?

Thank you

Attachments
app.module_setting_combo_values_after_init.js
(5.38 KiB) Downloaded 55 times

Post by mats »

To replace data in a store you can use: https://bryntum.com/docs/scheduler/api/Core/data/Store#property-data

 editor.store.data = newData;

Post by jandresampaio »

Nope...doesn't seem to work...Picker is not refreshed.

Example attached

Attachments
app.module_setting_combo_data.js
(5.37 KiB) Downloaded 64 times

Post by alex.l »

Could you please show the whole code? Where do you call it?
Did you see an example here: https://bryntum.com/docs/grid/api/Grid/feature/CellEdit#loading-remote-data-into-a-combo-box-cell-editor

All the best,
Alex


Post by alex.l »

Ok, I checked your code. nameCombo - is an object and not a link to an initialized field. Please check the link I posted, it will help you to figure it out.

All the best,
Alex


Post by jandresampaio »

The whole code is in my previous post, on your paged grid online example. The code is called at the bottom.


Post by alex.l »

Yes, sorry. Please check my last post, I did't refresh the page while typing, that's why I missed your update.

All the best,
Alex


Post by jandresampaio »

That example is not useful. We don't use an url to fetch the data.

So what is the initialized field?
Even querying the column by using

bryntum.query("grid").columns.getById('firstname').editor.store.data = newData 

won't make it work as suggested.

We need to have the filterBar possible values loaded before cell editing, to be able to restore the grid filter state.


Post by mats »

You can try this here https://bryntum.com/examples/grid/columntypes/

On console

grid.columns.getAt(8).editor.store.data = [{ text : 'red' }, { text : 'white' }]
Attachments
Screenshot 2021-11-29 at 14.18.14.png
Screenshot 2021-11-29 at 14.18.14.png (22.97 KiB) Viewed 796 times

Post by jandresampaio »

So, maybe I didn't explain myselft well. The rows editor combo is updated but the filterBar doesn't


Post Reply