Home > Net >  For help: the bootstrap - paging bar table can't show the lower right corner
For help: the bootstrap - paging bar table can't show the lower right corner

Time:10-10


The controller code
Public ActionResult newsData ()
{

Int pageSize=int. Parse (Request/" pageSize ");
Int pageIndex=int. Parse (Request/" pageNumber ");
Var list=db. News. OrderBy (p=& gt; P.i d). Skip ((pageIndex - 1) * pageSize.) Take (pageSize);
Int count=list. The count ();
Var result=JsonConvert. SerializeObject (new {rows=list, total=count});
Return the Content (result);
}

The view layer
<script SRC="https://bbs.csdn.net/topics/~/resouce/bootstrap-3.3.7/dist/js/jquery-3.3.1.min.js" & gt; </script>
<script SRC="https://bbs.csdn.net/topics/~/resouce/bootstrap_table/bootstrap-table-develop/dist/bootstrap-table.js" & gt; </script>
<script SRC="https://bbs.csdn.net/topics/~/resouce/bootstrap_table/bootstrap-table-develop/dist/locale/bootstrap-table-zh-CN.min.js" & gt; </script>
$(function () {
$(" # bt_table "). BootstrapTable ({
Url: "/admin/newsData",
ContentType: "application/x - WWW - form - urlencoded",
Pagination: true,//whether paging
SidePagination: "server",//the server page
Initialization pageNumber: 1,//load the first page, the default page 1
PageSize: 5, article//page shows data for
PageList: [3, 5, 7, 9],//article page shows the number of available
QueryParamsType: "",//set to 'limit' will be sent in accordance with RESTFul format parameters,
QueryParams: function queryParams (params) {
Var pa={
PageSize: params pageSize,
PageNumber: params pageNumber
}
Return pa;
},
PaginationPreText: "previous page",
PaginationNextText: "next page",
The columns: [
{
Title: 'id',//table column name
Field: 'id',//the json data in rows in the array attribute name
Align: 'center'//horizontal center

}, {
Title: 'headline',//table column name
Field: 'titleName,//the json data in rows in the array attribute name
Align: 'center'//horizontal center

}, {
Title: 'content',//table column name
Field: 'content',//the json data in rows in the array attribute name
Align: 'center'//horizontal center

}]
})

})
</script>

<body>





The actual effect of page

Is always displayed

CodePudding user response:

Just to get the post my code for reference

 

$(' # manage1). BootstrapTable ({
//contentType: "application/x - WWW - form - urlencoded",
//method: "post",//using the get request to the server to get data
Data: the result,//to get the data of the Servlet address
Pagination: true,
PageSize: 5,
SearchAlign: "right,"
ButtonsAlign: "left",
SearchOnEnterKey: false,
SingleSelect: true,
//showColumns: true,//show drop-down box select to display the columns of the
//showRefresh: true,//show the refresh button
//clickToSelect: true,
MaintainSelected: false,
Search: true,
//striped: true,
//height: 550,
//classes: "the table - no - bordered",//set the background color in
//queryParams: function (param) {
//return {};
//},
PaginationLoop: true,
The toolbar: '# toolbar',//toolbar ID
ToolbarAlign: 'right',//toolbar alignment
//onLoadSuccess: function () {//loaded successfully executed when
////alert (" load success ");
//},
//onLoadError: function () {//load failed to perform
////alert (" load data failure ");
//},
//the onCheck: function (row) {
//the console. The log (row. Imgid);
//checkUpdateDate (row. Imgid, 1);
//},
//onUncheck: function (row) {
//checkUpdateDate (row. Imgid, 0);
//},
The columns: [
{
Field: 'id',
Align: 'center',
Title: 'number',
Width: '10',
Valign: 'middle',
//sortable: true,
The formatter: function (the value, the row, the index) {
Return index + 1;
}
},
{
Field: 'welding general,
Align: 'center',
Valign: 'middle',
Title: 'welding general,

The formatter: function (the value, the row, the index) {
Return row. Welding in general;
}
}, {

Align: 'center',
Valign: 'middle',
Title: 'joint quantity (tao),
Width: '100',
The formatter: function (the value, the row, the index) {

Return the STR;
}

}, {

Align: 'center',
Valign: 'middle',
Title: 'welding length (m),
Width: '100',
The formatter: function (the value, the row, the index) {

Return the STR;
}
}, {
Align: 'center',
Valign: 'middle',
Title: 'days (practical/effective)',
Width: '190',
The formatter: function (the value, the row, the index) {

Return the STR;
}
}, {
Align: 'center',
Title: 'efficiency',
Valign: 'middle',
Width: '100',
//sortable: true
The formatter: function (the value, the row, the index) {

Return the STR;
}
},
{

Align: 'center',
Title: 'welding progress',
Valign: 'middle',
Width: '220',
The formatter: function (the value, the row, the index) {

Return the STR;
}
}
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related