https://bootstrap-table.com
http://github.com/vitalets/x-editable
$("#table").bootstrapTable({
url: "",
editable: true,
columns: [
{
title: that.columns['Operate'],
field: '_',
align: 'center',
}, {
title: that.columns['x1'],
field: 'x1',
align: 'center',
editable: {
canEdit: true,
type: 'number',
validate: function (v) {
if (v.length > 9) {
return "数字超出范围";
}
}
},
cellStyle: function (value, row, index) {
if (value == undefined || value == "" || isNaN(value)) {
return { css: { "background-color": "yellow" } }
}
else {
return { css: { "background-color": "white" } }
}
},
formatter: function (value, row, index) {
if (value == null || value == 'NaN') {
return "";
} else {
return value;
}
}
}]