How to detect first, previous, next, last button clicked in full pagingType

How to detect first, previous, next, last button clicked in full pagingType

inquisitive_sthainquisitive_stha Posts: 7Questions: 6Answers: 0
edited January 2019 in Free community support

I have a huge table so fetch offset, limit is not going to work as it is taking ages. So, I am thinking to move to key seek paging method so my query is going to be different for each click as mentioned below:

/First/
select top (1000) id,name from table_name order by id desc;
/returns data from 56679923-56678924/

/Next/
select top (1000) id,name from table_name where id < @previous_lowest_id order by id desc;
/returns data from 56678923-56677924/

/Previous/
SELECT * FROM (select top (1000) id,name from table_name where id > @previous_highest_id order by id asc) as myAlias ORDER BY id desc ;
/returns data from 56679923-56678924/

/Last/
SELECT * FROM (select top (1000) id,name from table_name order by id asc) as myAlias ORDER BY id desc

So, I need to run different query according to clicked buttons. So, necessity of detecting different click is arised. If there is any inbuilt method that's great. Otherwise, any other hacks to deal with this situation is also welcomed.

Furthermore, I can see different id on each li something like

<li class="paginate_button page-item next disabled" id="DataTable_next"> <a href="#" aria-controls="coloradoDataTable" data-dt-idx="2" tabindex="0" class="page-link">Next</a> </li>

So, I have also tried doing the following but with no success

$('#DataTable_last>a').click(function() { alert('zz'); });

How, can I get rid out from this problem.

Replies

This discussion has been closed.