Home > Back-end >  Solution: how to use dynamic js automatically generated form the column
Solution: how to use dynamic js automatically generated form the column

Time:05-13

Js code:

$(' # table ')
BootstrapTable (
{
Method: 'get',//server data request way the get or post
Url: the prefix + "/list",//server data loading address
//showRefresh: true,
//showToggle: true,
//showColumns: true,
IconSize: 'the outline,
The toolbar: '# exampleToolbar',
Striped: true,//set to true will be interlaced effect
DataType: "json",//the server returns the data type of the
Height: $(window). Height () - 80,
Pagination: true,//set to true will display in the bottom of the page article
//queryParamsType: "limit",
////set to limit will be sent in accordance with RESTFull format parameter
SingleSelect: false,//set to true will ban the multiselect
//contentType: "application/x - WWW - form - urlencoded",
////sent to the server data encoding type
PageSize: 10,//if set the paging, article data for each page
PageNumber: 1,//if set up distribution, home page
PageList: [10, 25, 50, 100],
SmartDisplay: false,
//search: true,//display the search box
Whether showColumns: false,//display content drop-down box, select the columns to display)
SidePagination: "server", where//set the paging, optional value is "client" or
QueryParams: function (params) {
Return {
Id: the id
};
},
The columns: [
{
Field: 'img2',
Title: "I want to make the place can display the different data according to the condition",
Width: 120 px,
The formatter: function (the value, the row, the index) {
The console. The log (row)
}
}
]
});
  • Related