Closed bootexe closed 2 years ago
I have corrected the problem by passing the data and initializing the flexdatalist on the result of the fetch
fetch(endpoint+'/user/list',{
method:'GET',
mode:'cors',
headers:{
'Authorization':authtoken
}
})
.then(resp => resp.json())
.then(response => {
$('#shootingCtrl #adduser .flexdatalist').flexdatalist({
minLength: 1,
textProperty: '{firstName} {lastName}',
valueProperty: 'mail',
selectionRequired: true,
visibleProperties: ["lastName","firstName"],
searchIn: ['lastName','firstName','mail','phone'],
data: response,
noResultsText:lang.error.NO_RESULT
})
})
Hi thanks for your library ! its really useful but I have a question dont know if its me but I can't add headers to the Ajax request I am sure its a dumb thing I havent seen but all seems logic to me right know
this code is executed after DOMLoadedContent and the server is a sub domain api.code.com of the one hosting the website code.com but CORS has been enabled on both side and everything is working fine in other part with fetch like this one
Can u please help me iam lost The request is sended without the custom header