Help to customize events of paging
Help to customize events of paging
Hi,
My website have two types of user. I want to disable the users of one type clicking the pagination button. When they click, an alert box appear and no change for the current data displayed (but they can see the pagination button ). So they can only see the data of page one.
I try to bind the click event like below:
[code]
$('.paging_full_numbers span').live('click', function () {
alert('you can only see the content of page one!");
});
[/code]
it will popup a alert box, but still do paging operation.
How should I do ?
My website have two types of user. I want to disable the users of one type clicking the pagination button. When they click, an alert box appear and no change for the current data displayed (but they can see the pagination button ). So they can only see the data of page one.
I try to bind the click event like below:
[code]
$('.paging_full_numbers span').live('click', function () {
alert('you can only see the content of page one!");
});
[/code]
it will popup a alert box, but still do paging operation.
How should I do ?
This discussion has been closed.
Replies
Allan
I add return false after alert(); but the paging action is also fire. The version of datatable i use is 1.8.0
[code]
$('.paging_full_numbers span').live('click', function () {
alert('you can only see the content of page one!");
return false;
});
[/code]
Why?
Allan
[code]
$(document).ready(function() {
otable = $('#example').dataTable( {...} );
$('.paging_full_numbers span').unbind('click');
$('.paging_full_numbers span').unbind('selectstart');
$('.paging_full_numbers span').unbind('mousedown');
$('.paging_full_numbers span').live('click', function () {
alert('you can only see the content of page one!');
return false;
});
});
[/code]
I am a beginner in javascript language, is there any error in the above code? Thanks