Filling autoComplete field on the fly

Filling autoComplete field on the fly

dynasoftdynasoft Posts: 338Questions: 54Answers: 3
edited January 30 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

Sign In or Register to comment.