Created
November 29, 2015 05:19
-
-
Save nurfarazi/1c27cf1b28d47c971829 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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