Z
Z
Zanak2019-02-06 17:57:31
C++ / C#
Zanak, 2019-02-06 17:57:31

The data in jquery-ui.autocomplete comes, but the list is not displayed, no one has encountered such a problem?

I'm trying to use autocomplete like this:

$myCtrl.autocomplete({
    source: function (request, response) {
        var term = request.term;
        $.ajax({
            url: '[% Env("Baselink") %]Action=RS_Diagnosis&Subaction=GetCustomerUser&[% Env("SessionName") | html %]=[% Env("SessionID") | html %]&term=' + term,
            type: "get",
            dataType: "json",
            success: function (data) {
                response(data);
            },
        });
    },
    minLength: 2,
    delay: 600,
});

Data from an external source comes, I can display it with an alert, or to the console, but the list with options is not presented.
A slightly preformatted server response:
[
    {"id":"first","value":"first","label":"First <[email protected]>"},
    {"id":"olga","value":"olga","label":"Olga <[email protected]>"},
    {"id":"zanak","value":"zanak","label":"Zanak <[email protected]>"}
]

The content-type in application/json is exposed by the server.

The whole brain is broken, what can be. Help, if anyone stepped on this rake and knows the method of treatment.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
F
Fat Lorrie, 2016-07-15
@stigmt

This is the initialization of the class fields.
If you wrote in Java style - like this ( we'll QObjectskip it for now):

Get::Get(const QString &peer, const QString &objectId, QObject *parent) :
    QObject(parent)
{    
    this->peer = peer;
    this->objectId = objectId;
    this->socket = new QUdpSocket(this);
    ...

then the members ( peer, objectId, socket) would first be created with their default constructors and then assigned to them . That is, these are 2 actions, instead of one - calling the correct constructor immediately ( initialization ).
As for QObject, it is the parent class for the type Get, so you also need to call the constructor on itQObject(QObject *parent)

V
Valentin, 2019-02-06
@romanko_vn

1. select one field, let's say label
2. json_decode

Z
Zanak, 2019-02-08
@Zanak

Question removed.
The explicit indication of z-index for the control, to which the autocompleter is attached, helped. Under the penguin, everything worked without it, but under M $ it didn’t work. It is a pity that I did not see this in a pile of layers earlier.
Thank you all for your attention.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question