I am populating checklist using remote source. My problem is that the remote source returns
{count: n, results: {...}}, and x-editable doesnt expect to have to look in response.results to get the list.
I have tried the following, which does not solve:
$ages.editable({
type: 'checklist',
source: '/api/ages/',
sourceOptions: {
success: function(resp){
return resp.results;
}
}
})
Using console, I can see that .success is being hit, but the behaviour on screen is the "loading" spinner keeps on spinning.
$.ajax has dataFilter callback, which passes return value to success. Note dataFilter must return JSON, so below works:
dataFilter: function(resp){
return JSON.stringify(JSON.parse(resp).results);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With