Quantcast
Channel: DataTables 1.9 — DataTables forums
Viewing all articles
Browse latest Browse all 1817

page event firing even when a disabled pager is clicked

$
0
0
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 ):
$(oSettings.oInstance).trigger('page', oSettings);
			
return iOldStart != oSettings._iDisplayStart;


Shouldn't it be something like this instead:

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


I am using v1.9.4. Thank you, again.

Viewing all articles
Browse latest Browse all 1817

Trending Articles