Reply To: Cascading dropdowns – EXTERNAL LIST

Forums Cascading dropdowns Cascading dropdowns – EXTERNAL LIST Reply To: Cascading dropdowns – EXTERNAL LIST

#25271
lzuhuo
Participant

Good morning Alex.
I would like to use an API as a dataSourceArray in cascading-dropdown solution.
My API returns an Array, but when I try to use it, this is my console log in attachment.
This is my code


var dataSourceArray;
$.ajax({
    url:"/api/sp/rfids/permitidos",
    success: function(json) {
        // Do stuff with data
        dataSourceArray = json;
        console.log(dataSourceArray);
    },
    error: function(e) {
       console.log(e);
    }
});

spjs.casc.init(
    {
    "manualMode":true,
    "dataSource":dataSourceArray,
    "lookupList":"",
    "lookupListBaseUrl":"",
    "lookupListFields":["Title"],
    "thisListFields":["DS_REDE"],
    "dropDownDefaultvalue":"Select...",
    "filter":"",
    "hideEmptyDropdowns":false,
    "autoselectSingleOption":true,
    "clearInvalidSelection":false,
    "addOwnValue":false,
    "addOwnValueMouseover":"",
    "cancelOwnValueMouseover":"",
    "sideBySide":true,
    "debug":false
    }
);
Attachments: