sorting by a column taking into account all pages of pagination
sorting by a column taking into account all pages of pagination
Hello. I got a problem with datatables. I want to sort rows by a column with username. There is also a pagination. The problem is that the table is sorted only on the first page. The second page is not taken into account when sorting. In other places in my project datatables sorts well column through a few pages. But only in that one place it sorts wrong (only first page). The code is similar and I want to add that I use ajax source in the table which sorts wrong. Any help will be appreciated.
This discussion has been closed.
Replies
Allan
[code]
SELECT DISTINCT a.displayname, a.username, b.profile_name , b.version, c.status FROM upm_applied_profiles a, upm_profiles b, upm_applied_status c WHERE a.base_profile_id = b.profile_id AND a.p_applied_id = c.p_applied_id AND c.status <= 17500 AND displayname IN ( SELECT displayname FROM ( SELECT ROWNUM AS rn, subtable.* from ( SELECT DISTINCT ap.displayname FROM upm_applied_profiles ap, upm_profiles ba, upm_applied_status ce WHERE ap.base_profile_id = ba.profile_id AND ap.p_applied_id = ce.p_applied_id AND ce.status <= 17500 ORDER BY ap.displayname ) subtable WHERE ROWNUM < 16 ) WHERE rn >= 1 ) ORDER BY a.displayname asc, a.username, b.profile_name
[/code]
The clause ORDER BY is set by variable (asc or desc whether request.getParameter("sSortDir_0") has appropriate value). I think that something is wrong with the query. Any thoughts? Previous post is answered by myself because if the sorting indicator is clicked it changes sorting order and the query. Please help :). Regards Allan.
Thanks Allan. Greetings.