前提条件:製品名を検索する機能など、カスタム検索およびページング機能。
現象:インフレータブル人形を検索するときは、100レコードを返して5ページに頼ります。この時点で、マッサージスティックを検索します。200個のデータがあり、結果は最初のページのレコードですが、実際のディスプレイは5番目のページの結果です。つまり、もう一度検索した後、ページナンバーは変わっていません。
オンラインのほとんどのことによると:リセットオプションだけ
$( '#tablelist')。bootstraptable({pagenumber:1、pagesize:10});上記はこの問題を解決することはできません。
それを行う正しい方法はです
$( "#table")。bootstraptable( 'destroy');テーブルを最初に破壊する必要があります。
tableobj.otableInit();テーブルを再開します。
コードは次のようになります:
<script type = "text/javascript"> $(function(){tableobj.otableinit(); $( "#btn_query")。 {$ .Messager.Alert( 'TIP'、 'レコードを削除するレコードを選択してください');}); $( "#btn_add")。 TableOtableInit:function(){$( '#tb_departments')。bootstraptable({url: '/department/getdepartment'、// url(*)メソッドをリクエストする方法: 'get'、// request method(*)toolbar: '#toolbar'、// cositer striped by botton button buttun cake://デフォルトはTRUEなので、一般に、このプロパティ(*)ページネーションを設定する必要があります:true、//ページ表示(*)sortable:false、// sortorderは "asc"、// sorting methods // queryparams:tableobj.queryparams(this)、// passeTers(*)queryparams:unfunce(*)pageded(*)を渡す必要があります。 this.pageNumber、pagedsize:this.pagesize、deptname:$( "#txt_search_departmentname")。val()、};}、 "server"、// pagination method:クライアントクライアントページネーション、サーバーサーバーページネーション(*)ページネンバー:1、 (*)PageList:[5、10、25、50、100]、//ページあたりの行数を選択する(*)検索:false、//テーブル検索を表示するかどうか、この検索はクライアント検索であり、サーバーに入ることはないと感じているので、true、showcolumns:true、//すべての列のshowresh:ruefrunm:strue fring fry fry spring ons frums ond ons ond eming ond ons ond ons ond ons ond ond ond on on shows sear columns allowed clickToSelect: true, //Does the click to select row height: 500, //Line height. If the height attribute is not set, the table will automatically feel the height of the table according to the number of records. UniqueId: "deptID", //The unique identifier of each row is generally the primary key column idField: 'deptID',showToggle: true, //Does the toggle buttons for detailed view and list view cardView: false, //詳細ビューの詳細view:false、//親と子のテーブル列:[{// field: 'deptid'、// field: 'deptid'、checkbox:true}、{field: 'deptname'、 'department name'}、{field: 'createby'、title: 'person'}、{filed: 'create == '未定' || ' - ':val.FormString(false);}];}}上記は、ブートストラップテーブルのページングと再検索のブートストラップテーブルの解決策であり、ブートストラップテーブルが紹介された後に問題を再検索します。それがあなたに役立つことを願っています。ご質問がある場合は、メッセージを残してください。編集者は時間内に返信します。 wulin.comのウェブサイトへのご支援ありがとうございます!