Only displaying X number of results even if more are returned
Only displaying X number of results even if more are returned
This might sound like an odd request but is there anyway to have it show only, let's say 10 results, even if more are returned? I don't want 10 per page, I just want 10 total. (or whatever number I decide). I am currently returning a bigger results set because of the way I have to get the info from the database. But I only want to display the top 10 answers and the rest wouldn't show. If i use pagination I can get it to show 10 on every page (I don't want this). If I turn pagination off then it shows all 100 (I don't want this either). I just want to see the top 10
Any help would be great!
Any help would be great!
This discussion has been closed.
Replies
1. Use pagination, but remove the pagination control :-). Bit of a cheat, but its probably the easiest way - just remove the 'p' option from sDom .
2. Use fnServerData and 'post-process' your returns array. Chop it down to the size you want and then give it to DataTables for rendering.
Allan