Skip to content

Create a dynamic select control on childgrid #6725

Answered by wezmag
rhemasystems asked this question in Help
Discussion options

You must be logged in to vote

In your LineItemListEditor.ts file, add below code.

I used existing Language module as an example.

private languageSelect: JQuery;

constructor(container: JQuery) {
    super(container);

    LanguageService.List({}, (response) => {
        this.languageSelect = $("<select></select>");
        this.languageSelect.append("<option></option>"); //for placeholder
        for (const item of response.Entities) {
            this.languageSelect.append(format("<option value='{0}'>{1}</option>", item.Id.toString(), item.LanguageName));
        }
        this.toolbar.element.append(this.languageSelect);
        this.languageSelect.select2(<any>{
            allowClear: true,
            placeholder: 

Replies: 3 comments 3 replies

Comment options

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

Comment options

You must be logged in to vote
2 replies
@wezmag
Comment options

@sapster77
Comment options

Answer selected by rhemasystems
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
3 participants