通过项目才知道.dataTable(),觉得真心好用,它可以让你的jsp代码变得简洁,告别循环。
var aoColumns = [ {
"mDataProp" : "ext1"
}, {
"mDataProp" : "ext2"
}, {
"mDataProp" : "ext3"
}, {
"mDataProp" : "ext4"
}, {
"mDataProp" : "ext5"
}, {
"mDataProp" : "ext6"
}, {
"mDataProp" : "planStartDt"
}, {
"mDataProp" : "planEndDt"
}, {
"mDataProp" : "distId"
} ];
var aoColumnDefs = [ {
"aTargets" : [ 8 ],
"mRender" : function(data, type, full) {
var editBtn = "<button class='btn btn-success fa fa-pencil' data-id='"
+ data
+ "' id='edit' style='font-size:12px;line-height:12px;'> 编辑</button>";
var deleteBtn = "<button class='btn btn-danger fa fa-re