で動作しましpagination: "remote"
たが、**何らかの理由で、.net でカスタマイズ ajax 関数を使用する必要があります **ajaxURL
オプションではありません。
それは機能のリクエストですか?事前に助けてくれてありがとう。
次のコードは次のとおりです。
- ページネーション: ajax をカスタマイズした "リモート" (動作します)
<script src="https://cdn.bootcss.com/jquery/1.10.2/jquery.min.js"></script>
<link href="https://unpkg.com/tabulator-tables@4.1.2/dist/css/tabulator.min.css" rel="stylesheet">
<script type="text/javascript" src="https://unpkg.com/tabulator-tables@4.1.2/dist/js/tabulator.min.js"></script>
<script>
function queryRealm(url, config, params) {
return new Promise(function (resolve, reject) {
$.ajax({
url: 'data.php',
success: function(data){
resolve(JSON.parse(data));
},
error: function(error){
reject(error);
}
})
});
}
var table = new Tabulator("#example-table", {
ajaxRequestFunc: queryRealm,
pagination: 'remote',
columns: [{
title: "id",
field: "id",
},
{
title: "Name",
field: "name",
width: 200
}
],
height: "292px",
});
- ajaxProgressiveLoad: ajaxをカスタマイズして「スクロール」(動かない)
に変更pagination: 'remote',
するだけajaxProgressiveLoad: "scroll"
そしてdata.phpは次のとおりです。
$data = [
["id"=>1, "name"=>"Billy Bob============"],
["id"=>2, "name"=>"Mary May"],
["id"=>3, "name"=>"Christine Lobowski"],
["id"=>4, "name"=>"Brendon Philips"],
["id"=>5, "name"=>"Margret Marmajuke"],
["id"=>6, "name"=>"Christine Lobowski"],
["id"=>7, "name"=>"Brendon Philips"],`enter code here`
["id"=>8, "name"=>"Margret Marmajuke"],
["id"=>9, "name"=>"Margret Marmajuke"],
];
echo(json_encode(["last_page"=>10, "data"=>$data]));
画像を更新して ajaxUrl オプションを有効にする