I am using x-editable and would like to know how to populate my select element using jquery and ajax.
[EDIT - For clarity]
This is my code:
jQuery(document).ready(function() {
    //toggle `popup` / `inline` mode
    $.fn.editable.defaults.mode = 'popup';
    var getSource = function() {
        var url = "/api/rpc/payments/status_options";
        $.ajax({
            type:  'GET',
            async: true,
            url:   url,
            dataType: "json",
            success: function(responseObject){
            }
        });
    };
    //make status editable
    $('.payments-click').editable({
        type: 'select',
        title: 'Select status',
        placement: 'right',
        value: 2,
        source: getSource()
        /*
         //uncomment these lines to send data on server
         ,pk: 1
         ,url: '/post'
         */
    });
});
I am trying to get the source:
source: getSource()
From the function but am not 100% sure how to return the data from the Ajax call.
 
     
    