javascript - jQuery Datatables get first displayed row custom attribute -
i need first displayed row value of data-rownum
attribute when next page event if fired.
my html table:
<tr data-rownum="1">some text</tr> <tr data-rownum="2">some text</tr> <tr data-rownum="3">some text</tr>
here code use, not getting value, object.
$('#historico').on( 'page.dt search.dt order.dt', function () { alert(tabla.row( 0 ).data('rownum')); } );
you need use row().node() row tr
node , to$() convert jquery object.
argument { 'order': 'current', 'search': 'applied', 'page': 'current'}
selector-modifier row() api function used retrieve row current page sorting , filtering applied.
$('#historico').on( 'page.dt search.dt order.dt', function () { alert( tabla .row( 0, { 'order': 'current', 'search': 'applied', 'page': 'current'} ) .node() .to$() .data('rownum')); });
Comments
Post a Comment