I'm struggling with this for several days. I'm trying to implement Sergio Llanna's server-side solution to my existing project.
Sergio's DataTables server-side processing
and this is my implementation:
My DataTables server-side processing
The difference is, that my solution grabs the data from MySQL database instead of local file. I think that I'm pretty close to make it work, data from database are displayed in the table correctly. When I turn off serverSide option, sorting and searching is working fine, but when I turn it on, everytime I click on the column, search or anything else I get just "Processing..." Flask debug mode is on. There is no error in the browser's development tools or flask development server.
My JSON XHR (response):
{
"data": [
{
"cola": "Hello",
"colb": "How is it going",
"colc": 1,
"cold": 4
},
{
"cola": "Sample text",
"colb": "Another sample",
"colc": 2,
"cold": 9
},
{
"cola": "Kurnik hosi",
"colb": "Guten tag",
"colc": 3,
"cold": 3
},
{
"cola": "Achiles",
"colb": "Patus",
"colc": 4,
"cold": 1
},
{
"cola": "Kim",
"colb": "Kiduk",
"colc": 5,
"cold": 8
},
{
"cola": "Pastina",
"colb": "Zavada",
"colc": 6,
"cold": 9
},
{
"cola": "Dolna",
"colb": "Marikova",
"colc": 7,
"cold": 9
}
],
"draw": 1,
"recordsFiltered": 10,
"recordsTotal": 7
}
I think the problem is with the request sent from browser, but this is my first Python/Flask project, so I'm not sure. Thank you for any advice.
Used technologies: OS Debian 9, DB MariaDB 10, Flask-SQLAlchemy