【发布时间】:2017-10-30 22:17:07
【问题描述】:
我需要用 DataTable Jquery 动态创建一个表,该表必须是 Server-side processing 类型并且在同一个请求中( Ajax) 和回答列都做了,结果很明显。
DatosColumna=""//Json with Response of ajax
$('#table_query_info').dataTable({
columnDefs: DatosColumna,//Here its the headers
destroy: true,
processing: true,
serverSide: true,
ajax: {
url: myBaseUrl + "consults/find_docs",
type: "post",
data: function (d) {
d.datos = make_info()//Send Json with info
},
statusCode: {
200: function (resp) {
alert("OK");//That Good
}
}
}
});
我尝试使用此代码,但没有成功
非常感谢
【问题讨论】:
-
欢迎来到 StackOverflow!如果您遇到特定编程问题,我们很乐意为您提供帮助,但我们不是来为您编写代码或设计您的系统的。您至少需要尝试解决您自己的问题。请参阅How do I ask a good question? 和What topics can I ask about here?。
-
jQuery 运行客户端。您使用什么 PHP 脚本来尝试制作表格?
-
我使用 PHP 但这不是我的问题,在我的 Json 中返回头部和行,但我不知道正确的形式
标签: php jquery json ajax datatables