Its just an example, not something you would probably want to copy and paste whole.
The idea is that you modify the SQL that runs based on a URL parameter (year in the example), with a reasonable default if the value is not sent.
// !!! DONT SQL INJECT !!! This is guaranteed to be a valid integer
// use wpdb->prepare if you are not sure !!!
'sql'=>'SELECT * FROM payments'.
' WHERE YEAR(date_entered)='.$year.
' ORDER BY ID date_entered DESC',
Then code this says, “on appropriate admin pages, enqueue the script that will change the table editor interface”.
add_action('admin_enqueue_scripts','xxx_register_scripts_admin');
function xxx_register_scripts_admin (){
if(@$_REQUEST['page'] == 'dbte_payments'){ // matches 'id' or 'table' above
$base_url = get_stylesheet_directory_uri();
wp_enqueue_script(
'payment-paging.js', $base_url . '/payment-paging.js', Array('jquery'));
}
}
The javascript, builds next and previous year buttons and adds them to the table editor page and has some code to handle query string variables.
I hope this helps, but without knowning the details of your table schema / query, its hard for me to provide specific advice.