Skip to content

How to change record after downloading from server? #2309

Answered by vitmalina
AlexVDem asked this question in Q&A
Discussion options

You must be logged in to vote

You can modify you function not to be a "lame horse" in the following way

onLoad(event) {
    event.done(() => {
        this.records.forEach(rec => {
            rec.department = deparartments[rec.departmentIndex]
        })
    })
}

This will create a field called department which you can render in the column. This presuposes that you already have js array with departments in js. You can load it before grid loads. See https://w2ui.com/web/docs/2.0/utils/events

Also, you can define your own formatter function and then it will auto populate, see https://w2ui.com/web/docs/2.0/w2utils.formatters

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@AlexVDem
Comment options

Answer selected by AlexVDem
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants