$(' # alarmList). BootstrapTable ({
The locale: 'useful - CN,
Url: the url,
Method: "get",
Type: "get",
UniqueId: 'no',
contentType: "application/json; Charset=utf-8,
"/* queryParams: function (params) {
Return a JSON. Stringify ({
//state: $(" # state "). Val (),
PageNo: params. Offset,
PageSize: params. Limit,
StationIds: stationIds. Join (", ")
});
}, */
Pagination: if true,//display paging
SidePagination: "the client",//paging: client client pages, server server pages (*)
PageSize: 10,
PageNumber: getPageNum (),//load the page number (state)
Search: true,//whether the display table search, the search is the client, not into the server, so the individual feels meaningless
ShowRefresh: true,//show the refresh button
ShowColumns: true,//show all the columns
ShowExport: true,//show the export button
ExportDataType: 'all',
SortName: 'updateDate,
SortOrder: 'desc',
ExportTypes: [' json, XML, 'the PNG', 'CSV', 'TXT', 'SQL', 'doc', 'excel', 'XLSX', 'PDF'],
The columns: [
{
Field: 'id',
Title: 'alarm ID',
Sortable: false
},
{
Field: 'no',
Title: 'equipment number'
},
{
Field: 'stationName,
Title: 'the site name,
Sortable: false
},
{
Field: 'regionName',
Title: 'name',
Sortable: false,
},
{
Field: 'deviceName,
Title: 'device name,
Sortable: false,
//the formatter: function (the value, the row, the index) {
//the console. The log (row);
//}
},
{
Field: 'color',
Title: 'level',
Align: 'center',
Sortable: false,
The formatter: function (the value, the row, the index) {
//the console. The log (row);
//return '& lt; Span style="background - color: '+ value +'; Width: 75 px; height: 25px; Border: 1 px solid # 424242; Float: left "& gt; '+ text + & lt;/span> ';
Return '& lt; Span style="color: '+ row. The color +'" & gt; '+ row. DetailRank + & lt;/span> ';
}
},
{
Field: 'content',
Title: 'alarm content',
Sortable: false
},
{
Field: "createDate",
Title: 'alarm time,
Sortable: false
},
{
Field: 'updateDate,
Title: 'update time,
Sortable: true,
},
{
Field: 'operator',
Title: 'operation',
Align: 'center',
The formatter: function (the value, the row, the index) {
If (row. Ignored) {
Return '& lt; A href="https://bbs.csdn.net/topics/#" onclick="load_detail (this, \ '+ row itemNo +' \ ', '+ row. Id +', \ '+ row deviceId +' \ ')" name="alarm_deal & gt;"+ '
'& amp; nbsp; & nbsp;
If this is the format, can be initialized with ajax method, but with $(" # alarmList "). The bootstrap (' the prepend 'data), cannot in the header to add data, the data is also the json data, that is to say the same format can initialize can't add, experience do you have a solution