How can I display the value in the select list?

I am making an ajax call to the rest module I implemented from Select2-list

input.vm

<div class="field-group"> <label class="label">Actor Select</label> <input id="select2-actor" type="hidden" name="actor" style="width: 400px;" placeholder="Add an actor"/> </div>

input.js

AJS.$("#select2-actor").auiSelect2( { placeholderOption: 'first', data: function () { var data = []; AJS.$.ajax({ url: AJS.params.baseURL+"/rest/leangearsrestresource/1.0/message/list/{actor}", dataType: 'json', async: false }).done(function(result) { AJS.log(result); for (var actor in result) { data.push({ id: result[actor] }); } }); return { results: data }; } } );

But only I can see in the chrome console is

Object {value: "{"actors":["AO_F51DA7_PRODUCT_ACTOR_CONF {ID = 1}"…D = 2}","AO_F51DA7_PRODUCT_ACTOR_CONF {ID = 3}"]}"}

whenever I click on Select-List field but no values in select list.

Category:javascript Time:2018-12-23 Views:2

Related post

Copyright (C) pcaskme.com, All Rights Reserved.

processed in 0.929 (s). 13 q(s)