updateAction: function(postData) {
console.log("updating from custom function...");
return $.Deferred(function($dfd) {
$.ajax({
url: 'HallManagementServlet?action=UpdateStudent',
type: 'POST',
dataType: 'json',
data: postData,
success: function(data) {
var last_payment_date = [];
$.each(data, function(entryindex, entry) {
last_payment_date.push(entry['payment_expires_on']);
});
var current_date = new Date();
if(Date.parse(last_payment_date)<Date.parse(current_date)){
paymentStatus = 'Due';
}
else{
paymentStatus = 'Paid';
}
$dfd.resolve(data);
},
error: function() {
$dfd.reject();
}
});
});
}
这里的paymentStatus就是那一列。它有两种选择。 更确切地说,这是专栏
paymentStatus: {
title: 'Payment Status',
width: '8%',
options: {'Paid': 'Paid', 'Due': 'Due'},
create: false,
edit: false,
list: true
},
我想设置updateAction的值。我怎么能这样做?