<script type="text/javascript">
function setParam(){
$('#example').dataTable({
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "./AccountSummary",//servletname
"fnServerParams": function (aoData) {
alert("A");
aoData.push({ "name": "a", "value": "b" });
}
});
}
</script>
函數調用取數據表初始化代碼出來的功能。你這樣做只是重新初始化表格。
var oTable = $('#example').dataTable({
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "./AccountSummary",//servletname
"fnServerParams": function (aoData) {
alert("A");
aoData.push({ "name": "a", "value": "b" });
}
});
給您的按鈕的ID:點擊按鈕事件
<div>
<input type="button" id="mybutton" value="click">
</div>
呼叫fnDraw():
$('#mybutton').click(function (e) {
oTable.fnDraw();
});
你有沒有說過上面的參數來自name
和value
,但這將在服務器請求中通過a
和b