-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Datatables does not work with a single column and server-side processing #294
Comments
Hi Jacob, I've tested with this sample: https://github.com/dandelion/dandelion-datatables-samples/blob/1.1.0/datatables-thymeleaf-ajax/src/main/webapp/WEB-INF/views/server-side/enabling-server-side-processing.html Regarding the column number, actually it has to begin at 0, just because the field is used both as a counter and as a column indexer, since DataTables requires the index to begin at 0. |
You can test with the following:
|
My bad. You're right from the very beginning! |
Sure, I'll get it fixed and open a PR in a few hours (after work) |
Great.
Thx! |
Fixes #294: DatatablesCriterias should return with single column defined
This is probably an unlikely case, but I noticed it while updating a test case for 1.1.0. DatatablesCriterias.getColumnNumber will return 0 (as in zero columns) if 1 column is defined.
Perhaps the
columnNumber
counter should begin at -1 (for no results), and take theMath.max(columnNumber, col)
. This way, theif (columnNumber != 0)
check may be removed, and a valid count will always be returned (0 if no request params were matched, # of columns otherwise).Specifically, I attempted sorting the datatable with a single column.
The text was updated successfully, but these errors were encountered: