目前在datatable中使用 jeditable.js 开发可编辑数据表我将timepicker放在可显示小时和分钟下拉框的可编辑数据表中。当我更新数据库中更新的值时,但当我在字符串中返回值时,它会在警告框中显示我的新值,并且数据表不会更新。
数据表与type = text,textarea完美配合,选择但不是时间戳
这是我在jedtiable.js中添加的时间码代码
time: {
element: function (settings, original) {
var hourselect = $('<select id="hour_"><option selected value="">HH</option>');
var minselect = $('<select id="min_"><option selected value="">MM</option>');
/* Hour loop */
for (var hour = 1; hour <= 12; hour++) {
if (hour < 10) {
hour = '0' + hour;
}
var option = $('<option>').val(hour).append(hour);
hourselect.append(option);
}
$(this).append(hourselect);
/* Minutes loop */
for (var min = 1 ; min <= 60; min++) {
if (min < 10) {
min = '0' + min;
}
var option = $('<option>').val(min).append(min);
minselect.append(option);
}
$(this).append(minselect);
/* Hidden input to store value which is submitted to server. */
var hidden = $('<input type="hidden">');
$(this).append(hidden);
return (hidden);
},
/* Set content / value of previously created input element. */
content: function (string, settings, original) {
/* Select correct hour and minute in pulldowns. */
var hour = parseInt(string.substr(0, 2), 10);
var min = parseInt(string.substr(3, 2), 10);
$('#hour_', this).children().each(function () {
if (hour == $(this).val()) {
$(this).attr('selected', 'selected');
}
});
$('#min_', this).children().each(function () {
if (min == $(this).val()) {
$(this).attr('selected', 'selected');
}
});
},
/* Call before submit hook. */
submit: function (settings, original) {
var value = $("#hour_").val() + ":" + $("#min_").val();
$("input", this).val(value);
}
}
将数据提交到服务器后,服务器端的值正确更新,但当我返回值时,此函数显示错误
function _fnShowError(errorText, action)
{
alert(errorText);
}
请指导我如何解决此错误
还请告诉我哪个是内联编辑的最佳数据表
注意:我是新手。