I am new to WordPress if someone will help me I will be very appreciate.
There is parameter ajax “true” but in docs. wasn’t said how to implement Ajax using WP_List_Table Class?
parent::__construct( array(
'singular' => 'user', //singular name of the listed records
'plural' => 'users', //plural name of the listed records
'ajax' => true //does this table support ajax?
) );
In the parent __construct args if ajax is set to true the js_vars will be output in the footer of the page.
The default javascript variables that get output in the footer are defined in the js_vars function:
Have you already taken a look on the WP_List_Table class Methods? There’s
ajax_response()
…ajax_response()
– use it to implement your custom permission rule setajax_response()
– handle your ajax callbacks/actions._js_vars()
– every var that you want to use inside your custom ajax callbacks. Works similar towp_localize_script()
.