bootstrap-table动态绑定字段?

bootstrap-table动态绑定字段


ibeautiful
浏览 1812回答 3
3回答

HUH函数

//使用ajax加载动态列的var columns = [];$.ajax({url: 'getColumns.action',type: 'post',data: data,dataType: "json",async: true,success: function (returnValue) {//异步获取要动态生成的列var arr = returnValue;$.each(arr, function (i, item) {columns.push({ "field": item.colname, "title": item.colalias, "width": 100, "sortable": true });});});$('#table_id').bootstrapTable('destroy').bootstrapTable({data: data,columns: columns......})

明月笑刀无情

$('#table_id').bootstrapTable('destroy').bootstrapTable({data: data,columns: [{field: 'whichperiod',title: '第几期'}, {field: 'overdueamounts',title: '逾期金额(元)'}, {field: 'overduedate',title: '逾期开始日期',}, {field: 'overduelong',title: '逾期时长'}, {field: 'reason',title: '逾期原因'}, {field: 'disposalstatus',title: '处置状态'}]});
打开App,查看更多内容
随时随地看视频慕课网APP