XEditable fails with DataTables warning: table id=DataTables_Table_0 - Ajax error

Issue #78 new
Former user created an issue

I am using an XEditableDatatableView in my app. But the view fails to render the table and displays the following warning:

DataTables warning: table id=DataTables_Table_0 - Ajax error. For more information about this error, please see http://datatables.net/tn/7

Inspecting the requests, the page tries to make a request (which fails with 502 error) with parameters ?draw=1, (and a bunch of column parameters).

The weird thing is: it works locally (same docker image). I am deploying to AWS Elastic Beanstalk with an Application Load Balancer. I think it has something to do with that. But I could not pinpoint the problem and wondered if you could enlighten me.

Comments (6)

  1. Pedro Viana

    I opened the issue above, did not see I was not logged in.

    Quick correction: it works when running django local runserver. But it fails when deploying the same docker image locally, as it fails deploying it to AWS. With the exception that locally it does not display any warning pop-up.

  2. Pedro Viana

    OK, thanks for the tip. If I find a solution, I’ll post it back here, maybe it can help somebody else.

  3. Pedro Viana

    Well, I found out a way to correct it: reducing the number of columns.

    I was using 7 columns and the response generated a very long URL with a “draw” query paramerter (?draw=1&columns%5B0%5D%5Bdata%5D=0&columns%5B0%5D%5Bname%5D=id&columns%5B0%5D%5Bsearchable%5D=true&columns%5B0…)

    I reduced the number of columns and it started working. I had probably reached a URL max length limit with all those columns.

    If you happen to know any other way to circumvent this limitation, I would be glad to be able to use 7 columns again 😟

  4. David Wasylciw

    Are you making the datatables request via GET or POST? By the long url, it looks to be GET. If you change it to POST you shouldn't have the learn url concerns, and if you're using x-editable to change server side data, a POST is a touch more secure.

  5. Pedro Viana

    Is there a way to configure that in datatables-view? This request is made by the code in this repo.

  6. Log in to comment