0
我在x-editable插件中遇到問題,如何在x-editable中以正確格式顯示價格?我想獲得像價格格式的值,如xx,xxx.xx?x-editable價格格式問題
我的代碼是
變種editVehiclePrice =函數(EL,選項){
var options = $.extend(true, {
url: Utils.siteUrl() + 'dashboard/sell_vehicle/inline_vehicle_edit/',
ajaxOptions: {
dataType: 'json'
},
mode: 'inline',
}, options || {
params: function(params) {
params.veh_id = $(this).data('vehid');
return params;
},
success: function(response, newValue) {
if(response.status == 0) return response.msg;
console.log(Utils.numberFormat(newValue,2));
$(response.to_update).text(newValue);
},
validate: function(value) {
if($.trim(value) == '') {
return 'This field is required';
}
}
});
$(el).editable(options);
}
也就是說的console.log將顯示正確的格式value..but當我更新它顯示在正常格式編號。請幫我
如果我們想顯示編輯後的任何變化