Column sorting doesn't work
Column sorting doesn't work
Hello, people!
Here I am again with a problem that I'm sure many here have faced already.
I have a table with 3 columns: one with sorting working fine, another not sortable, and the problem is with the third column, which is a numeric column. When I click on the column header to sort it, it just says "Processing...", but won't sort. My intent is to hid this third column and use iDataSort on the second column to sort by this third one, but once I can't get the sorting working, I can't do it.
If you could please take a look at http://myminnesotagolfcourses.com/minnesota-golf-course-reviews/ which is fed by http://myminnesotagolfcourses.com/minnesota-golf-course-reviews/server_processing.php and tell me what is wrong, I would be thankful.
Thanks in advance for any kind of help.
-
Marcos Alves
Here I am again with a problem that I'm sure many here have faced already.
I have a table with 3 columns: one with sorting working fine, another not sortable, and the problem is with the third column, which is a numeric column. When I click on the column header to sort it, it just says "Processing...", but won't sort. My intent is to hid this third column and use iDataSort on the second column to sort by this third one, but once I can't get the sorting working, I can't do it.
If you could please take a look at http://myminnesotagolfcourses.com/minnesota-golf-course-reviews/ which is fed by http://myminnesotagolfcourses.com/minnesota-golf-course-reviews/server_processing.php and tell me what is wrong, I would be thankful.
Thanks in advance for any kind of help.
-
Marcos Alves
This discussion has been closed.
Replies
Unknown column 'review_rating' in 'order clause'
So you're not even getting a new data set, just an error in the response.
1) How can you see these errors? I'm struggling here to debug because I can't see the errors :-(
2) I fixed the SQL code and now the sorting of the third column works fine. However, I don't know why but I can't use iDataSort on column 2 to sort by column 3. Once I'm able to do it, I'll hide this column ("bVisible": false). Can you help me on this? You can check it in the same URLs I posted before. The code I'm using is:
[code]"aoColumns" : [ { "sWidth": "60%" }, { "iDataSort": 2, "sWidth": "32%" }, { "sWidth": "3%", "sType": "numeric" }[/code]
3) Finally, how can I sort based on two columns: i.e. to sort by column 3 and then by column 2, so when I click on column 3 header (average rating) the table will be sorted by the average rating followed by course name, alphabetically.
Thanks,
-
Marcos Alves
1) I discovered that FireBug is an excellent tool to debug DataTables!
2) and 3) I fixed in the server side PHP script.
Thanks for all the help!
-
Marcos Alvers
greg