Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82416

EDITOR + AUTOCOMPLETE issue

$
0
0

Hi, all! I am trying to add an autocompete field to my table with editor, it looks like this:

{
                            label: 'Name(russian)',
                            name: 'rusName',
                            type: "autoComplete",
                            opts: {
                                source: function (request, response) {
                                    $.ajax({
                                        type: 'GET',
                                        headers: getJsonHeaders(),
                                        dataType: 'json',
                                        url: page + '/getAllByTraitAndPhrase/' + traitId,
                                        data: {termRus: request.term},
                                        success: function (data) {
                                            let mappedData = $.map(data, function (detail) {
                                                return {
                                                    label: detail.rusName,
                                                    value: detail.rusName
                                                };
                                            });
                                            response(mappedData);
                                        }
                                    });
                                },
                            },
                        },

The thing is, that the ajax call works and i got the data from the server, but the data doesn't appear in my editor field. No autocomplete. In "success" i got the objects from the server, map these objects to label/value and than nothing. What am I doing wrong? Help me, please.


Viewing all articles
Browse latest Browse all 82416

Trending Articles