Filling autoComplete field on the fly

Filling autoComplete field on the fly

dynasoftdynasoft Posts: 422Questions: 67Answers: 3
edited January 2020 in Editor

Hi

I have such a field which needs to be populated based on user selection in another drop-down. I tried using the code below in the success event of an ajax call but the field is not populated. Please advise.

                success: function (data) {
                    if (data != null && data != undefined && $.trim(data))
                    {
                        //alert('got here with data from ajax');
                        if (data.globalSubsPacksListViewModel != null) {

                                var availableTags = [
                                  "ActionScript",
                                  "AppleScript",
                                  "Asp",
                                  "BASIC"
                                ];

                                editor.field('CustomerSubsPacks.Name').autocomplete({
                                    source: availableTags
                                });

                            });
                        }

taken from https://jqueryui.com/autocomplete/

Js:

(...)
label: '@(lblo.lblName)*:',
name: 'CustomerSubsPacks.Name',
type: 'autoComplete',
opts: {
"source": [...],

Answers

This discussion has been closed.