当 ajax 调用失败时,如何阻止 Bootstrap x-editable 更新已编辑的字段?
我正在传递一个函数作为 url。
$('.order-price').editable({
type: "text",
title: "Order Price",
url: function (params) {
var orderID = $(this).data("order-id");
var data = "OrderID=" + orderID + "&Price=" + params.value;
$.ajax({
type: 'post',
url: '/Trades/SetOrderPrice',
data: data,
async: false,
error: function (xhr, ajaxOptions, thrownError) {
return false;
// Do I return something here instead of false?
}
})
}
});