JSFiddle - React, Tailwind, and code Playground
HTML
<script src="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/css/bootstrap-combined.min.css">
<link rel="stylesheet" href="http://vitalets.github.com/x-editable/assets/x-editable/bootstrap-editable/css/bootstrap-editable.css">
<script src="http://vitalets.github.com/x-editable/assets/x-editable/bootstrap-editable/js/bootstrap-editable.js"></script>
How are you ? <a href="#" id="my_select" data-pk="1" data-type="select" data-value="1"></a>
CSS
label {
cursor: pointer;
}
JavaScript
// my source that can change over time
var source = [{'value': 1, 'text': 'fine'}, {'value': 2, 'text': 'bad'}];
$('#my_select').editable({
'mode' : 'inline',
'source': source,
});
$('#my_select').on('shown', function(ev, editable) {
// now changing my source just before dropdown is shown
source = [{'value': 1, 'text': 'GOOD'}, {'value': 2, 'text': 'FU'}];
//$(editable).editable('option', 'source', source); NOT WORKING
//$('#my_select').editable('option', 'source', source); NOT WORKING
//$(this).editable('option', 'source', source); NOT WORKING
});