"Page" Event.

"Page" Event.

lingglingg Posts: 3Questions: 0Answers: 0
edited October 2013 in DataTables 1.9
Good day, everyone!

Please help me with "Page" event. I need to apply Bootstrap popovers on some elements in table, after elements are rendered. But after event fired jQuery selector of that elements = 0. So I think it fired before page rendered? and Why it works only with "Next" "Prev" buttons but not digits of pagination.

Thanks,
Mike

[code]
$('#manager').on('page', function(){
console.log('TRIGGER');
console.log($('.trigger').length);
bindPopovers();
}).dataTable({
"iDisplayLength": 1,
"sDom": "<'row'f<'progress-tb left'><'span6 right'<'dt_actions'>l>r>t<'row'<'span6'i><'span6 right'p>>",
"sPaginationType": "bootstrap_alt",
"aaData" : data,
"aaSorting": [[ 4, "asc" ]],
"aoColumns": [
{ "sTitle": "Status", "sClass": 'sensor-status-icon', 'sWidth': '60px'},
{ "sTitle": "Alert", "sClass": 'sensor-alert-icon', 'sWidth': '60px'},
{ "sTitle": "Sensor ID" , "sClass": 'pseudo-link', 'sWidth': '70px'},
{ "sTitle": "Area" },
{ "sTitle": "Equipment" },
{ "sTitle": "Sensor", "sClass": 'pseudo-link'},
{ "sTitle": "Actions", "sClass": 'actions-manager', 'sWidth': '100px', 'bSortable': false, },
],
"oLanguage": {
"sLengthMenu": "_MENU_ records per page"
},
"bAutoWidth": true,

});

[/code]

Replies

  • lingglingg Posts: 3Questions: 0Answers: 0
    anyone?
  • allanallan Posts: 63,381Questions: 1Answers: 10,449 Site admin
    The page event actually fires before the paging display is updated. You probably want to listen for the 'draw' event and rebind on that.

    Allan
  • lingglingg Posts: 3Questions: 0Answers: 0
    thank you so much!

    p.s. I suppose "Page" shoud fire when you click digits pagination buttons! cheers.
  • allanallan Posts: 63,381Questions: 1Answers: 10,449 Site admin
    I've been going back on forth on that - I'll probably leave it as is, but I'll make it clear in the documentation.

    Allan
This discussion has been closed.