javascript - X-editable processing json -


i trying implement remote select using x-editable. i've followed this example , got local select work.

according example, select input expects data in format "value|text".

my backend json respose

[{"id":1,"title":"..."},{"id":2,"title":"..."}] 

this html

<a href="#" id="remote-select" data-type="select" data-pk="1" data-url="/articles" data-title="select remote status"></a> 

i've learned, according this answer datafilter should used, don't know how manipulate response change keys, id value , title text.

i'd independent of key's text, works different types of responses, not ones 'title' key

jquery

$('#remote-select').editable({         value: 2,             source:'/articles.json',         datafilter: function(resp){          } });  


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -