Bootstrap Table
by jimkennelly
HTML
<link rel="stylesheet" href="https://rawgit.com/wenzhixin/bootstrap-table/master/src/bootstrap-table.css">
<script src="https://rawgit.com/wenzhixin/bootstrap-table/master/src/bootstrap-table.js"></script>
<div class="container">
<h1>Use responseHandler option to handle your response data(<a href="https://github.com/wenzhixin/bootstrap-table/issues/353" target="_blank">#353</a>).</h1>
<table id="table"></table>
</div>
JavaScript
var _obj= {
"messages": [
{
"id": 652,
"session_id": 8965861649940144331,
"date": "2014-12-17T01:01:09Z",
"m_type": "Error",
"message": "could not find a matching MDF file for legacy SQL selection $SQL:\\(local)\\Adams",
"file_name": "$SQL:\\(local)\\Adams",
"msdn": 33
},
{
"id": 653,
"session_id": 8965861649940144331,
"date": "2014-12-17T01:01:10Z",
"m_type": "Error",
"message": "could not find a matching MDF file for legacy SQL selection $SQL:\\(local)\\TRAINING",
"file_name": "$SQL:\\(local)\\TRAINING",
"msdn": 33
}
],
"session_id": 8965861649940144331,
"date": "2014-12-17T01:55:14Z",
"client_date": "2014-12-16T19:55:14Z",
"actual_cpu": "",
"licensed_cpu": "",
"license": 1,
"brand": 2,
"account": 215,
"computer": 289,
"regcode": "1:2:215:289"
};
$(function () {
$('#table').bootstrapTable({
columns: [{
field: 'date',
title: 'Date Stamp',
sortable: true
}, {
field: 'm_type',
title: 'Type',
sortable: true
}, {
field: 'msdn',
title: 'MSDN',
sortable: true
}, {
field: 'file_name',
title: 'File Name',
sortable: true
}, {
field: 'message',
title: 'Message',
sortable: true
}],
data: responseHandlerx(_obj)
});
function responseHandlerx(_obj) {
return _obj.messages;
}
});