page event firing even when a disabled pager is clicked

page event firing even when a disabled pager is clicked

IndusCreedIndusCreed Posts: 1Questions: 0Answers: 0
edited December 2013 in DataTables 1.9
Hi.

First of all, thanks for creating dataTables. I have used it in multiple projects and absolutely love it.

Anyways, I created this code snipped on Data tables live: http://live.datatables.net/ihipox/2/edit#javascript,html

When the "previous" button is clicked (which is disabled), the "page" event still gets fired. I would expect the event to fire only when the page is actually changed.

Here is dataTable code on line 2963 copied from function _fnPageChange ( oSettings, mAction ):
[code]
$(oSettings.oInstance).trigger('page', oSettings);

return iOldStart != oSettings._iDisplayStart;

[/code]

Shouldn't it be something like this instead:

[code]
var bPageChanged = iOldStart != oSettings._iDisplayStart;
if (bPageChanged) {
$(oSettings.oInstance).trigger('page', oSettings);
}
return bPageChanged;

[/code]

I am using v1.9.4. Thank you, again.
This discussion has been closed.