Skip to content

Insert column at the first position in grid #5799

Answered by minhhungit
ghost asked this question in Help
Discussion options

You must be logged in to vote

This code will make your selection column stay at first position

protected getPersistedSettings() {
    let setting = super.getPersistedSettings();

    let idCol = Q.tryFirst(setting.columns, x => x.id == "__select__");
    if (idCol) {
        setting.columns.splice(setting.columns.indexOf(idCol), 1);
        setting.columns.splice(0, 0, idCol);
    }

    return setting;
}

But make sure that the selection is not in hidden list

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@ghost
Comment options

@ghost
Comment options

@minhhungit
Comment options

Answer selected
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
Help
Labels
None yet
2 participants