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

Popular posts from this blog

facebook - android ACTION_SEND to share with specific application only -

python - Creating a new virtualenv gives a permissions error -

javascript - cocos2d-js draw circle not instantly -