Pegase745 / sqlalchemy-datatables

SQLAlchemy integration of jQuery DataTables >= 1.10.x (Pyramid and Flask examples)
MIT License
159 stars 67 forks source link

Data show only first record #52

Closed theavuthnhel closed 7 years ago

theavuthnhel commented 8 years ago

Hello!

This package is very useful, but now I have one problem with data showing it's show only one first record.

Here is my script:

$("#data_list").dataTable({
                "serverSide": true,
                "processing": true,
                "ajax": "{{ url_for('getAppData') }}?start=1&length=1&draw=1&model=Table&fields=field_list"
            });

Any solution here? Thanks in advance...

Pegase745 commented 8 years ago

I guess it's because of your length=1. Why would you put hard-coded query-strings like these ?

cf https://datatables.net/reference/api/length

theavuthnhel commented 8 years ago

Hello!

When I try to request without length, draw, start it's show the error from python code.

The error will be:

KeyError: 'start'
File "/home/theavuth/Documents/projects/loan/app/User/forms.py", line 62, in getAppData
rowTable = DataTables(request.args, eval(objdb), objquery, columns)
File "/usr/local/lib/python2.7/dist-packages/datatables/__init__.py", line 172, in __init__
self.run()
File "/usr/local/lib/python2.7/dist-packages/datatables/__init__.py", line 229, in run
self.paging()
File "/usr/local/lib/python2.7/dist-packages/datatables/__init__.py", line 466, in paging
Display the sourcecode for this frameOpen an interactive python shell in this frameif (self.request_values[displayStart] != '') \
Pegase745 commented 7 years ago

@theavuthnhel how did you manage to get around that in the end ?