数据表| fnreloadajax()无法正常工作 [英] datatables | fnreloadajax() is not working properly
问题描述
我试着去重新加载新的Ajax源数据表。
Im trying to reload the datatables from new ajax source.
我的意思是在页面加载从1源加载,但页面上的一些动作后,它需要从其他来源装载。
i mean on page load it loads from 1 source, but after some action on page, it needs to be loaded from another source.
我通过 fnreloadajax想它()
,但它不工作,我的意思是所有fnreload阿贾克斯这样做,它重载表中,但不是来自新源??
i am trying it through fnreloadajax()
but it is not working, i mean all fnreload ajax do, it reloads the table but not from the new source??
我没有阅读文档的 fnreloadajax()
http://www.datatables.net/plug-ins/api/fnReloadAjax
但是当我试图这样的。
var GroupID = e.val;
url = "admin/usersManagePermissions/listFormsInGroups_DT/"+GroupID;
oTable.fnReloadAjax(url);
我没有错误,而且数据表不新源重新加载表。它只是加载从previous /原始来源,定义它的表。
i got no error, but also datatables dont reload the table from new source. it only loads the table from previous/original source which was defined to it.
什么是错在这里?
推荐答案
今天我同样的问题,这里是我的解决方案:
I had same problem today, here is my solution:
这是该数据表客体,要小心,数据表()!=的dataTable()见<一href="http://stackoverflow.com/questions/25207147/datatable-vs-datatable-why-is-there-a-difference-and-how-do-i-make-them-w">this回答。
This is the datatable objet, be careful, DataTable() != dataTable() see this answer.
var tableRestr = $('#myDataTable').DataTable({
ajax: someUrl});
然后,总是在我需要从另一个URL重装,只要使用该两行:
Then, always when I need to reload from another url, just use this two lines:
tableRestr.ajax.url(newUrl);
tableRestr.ajax.reload();
这篇关于数据表| fnreloadajax()无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!