displaytag

how to get last row in display tag


I am using <display:table> tag to display data on web page.

<display:table style="min-width: 180%; max-width: 180%; table-layout: inherit;" 
                            class="ui small orange celled unstackable table" requestURI="JobFromInvoiceAEPre"
                            name="productList" pagesize="5" id="jobtable" export="false" 
                            clearStatus="${param['filter'] != null}" excludedParams="filter">

Columns are here..
.
.
</display:table>

My database table have 50 data and display table tag create pagination of 5 data per page.

My question is how to get last row data from display table tag from any pagination page?

I am using this below code for last row

$('#jobtable').find('tr:last').find('td').eq(
                                2).find('input:text').val();

but it return last row of particular page like pagination page is 2 then it return row no.10.

i want how to get data from row no.50 from any page. how to do this?


Solution

  • I got answer after so much thinking...

    In display tag total number of item display on above of header.

    actually, this total message in a span with class name pagebanner. I am get data from span and split total number part.code is below-

    var dtxt= document.getElementsByClassName('pagebanner')[0].innerHTML;
    

    and split code is below

    var txt=dtxt.split('items')[0].trim();
    

    It gives me last row number.

    if any one have other idea please share.