Skip to content

Instantly share code, notes, and snippets.

@nurfarazi
Created November 29, 2015 05:19
Show Gist options
  • Save nurfarazi/1c27cf1b28d47c971829 to your computer and use it in GitHub Desktop.
Save nurfarazi/1c27cf1b28d47c971829 to your computer and use it in GitHub Desktop.
jQuery(document).ready(function() {
//toggle `popup` / `inline` mode
$.fn.editable.defaults.mode = 'popup';
function getSource() {
var url = "/api/rpc/payments/status_options";
return $.ajax({
type: 'GET',
async: true,
url: url,
dataType: "json"
});
}
getSource().done(function(result) {
$('.payments-click').editable({
type: 'select',
title: 'Select status',
placement: 'right',
value: 2,
source: result
/*
//uncomment these lines to send data on server
,pk: 1
,url: '/post'
*/
});
}).fail(function() {
alert("Error with payment status function!")
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment