Our blazing fast Grid component built with pure JavaScript

Post by pkuehne_sharesuite »

Good morning.

Is there a way to change the value, that will be transmitted to the server?

For example I have a column with a combo that has mutliple users.
I still want to have the complete user object as value in the combo.
But if someone changes the user inside the combo, it should only commit the ID of the user as change to the server.

Also is it possible to change the format of the value that will be transmitted to the server? (not the displayFormat)


Post by arcady »

Combo has valueField which can be any field of the store.
And if the configured field keeps objects then an object will be returned from combo.value.

Then when persisting a model to the server its field values can be serialized if the field has serialize function provided.

Post by arcady »

You are asking of Bryntum Grid product, correct?

Post by pkuehne_sharesuite »

Yeah its about Bryntum Grid.

Can you show me a small example how to implement the serialize function?

Post by arcady »

const store = new Store({
    fields : [
        { name : 'foo', serialize : value => value ? value.id : value }

Post by pkuehne_sharesuite »

Perfect. This works fine.
Thanks :)

Post by pkuehne_sharesuite »

One more question here.
The store does not commit a change, when I remove the value with the clear button.

Is there something that I need to configure?

Post by tasnim »

You can listen for a change by listening to https://www.bryntum.com/docs/grid/api/Core/widget/Combo#event-change

Best of luck,

Post Reply