I like my widgets organized and small/neat without scrollbars. So, I had to add an pagination of [1] to both Non-MainWP changes and Monitor datatable.
Below the JS code for MainWP Custom Dashboard extension.
var waitForEl = function(selector, callback) {
if (jQuery(selector).length) {
callback();
} else {
setTimeout(function() {
waitForEl(selector, callback);
}, 100);
}
};
jQuery( document ).ready( function () {
// adjust non-mainwp action table page length
// hooking into wrapper
var selector = '#mainwp-non-mainwp-changes-table_wrapper';
waitForEl(selector, function() {
table = jQuery( '#mainwp-non-mainwp-changes-table' ).DataTable( {
"destroy":true,
"pageLength": 1,
"lengthMenu": [ [1, 5, 10, 25, 50, 100, -1], [1, 5, 10, 25, 50, 100, "All"] ]
} );
});
var selector = '#mainwp-aum-monitors-widget-table_wrapper';
waitForEl(selector, function() {
table = jQuery( '#mainwp-aum-monitors-widget-table' ).DataTable( {
"destroy":true,
"pageLength": 1,
"lengthMenu": [ [1, 5, 10, 25, 50, 100, -1], [1, 5, 10, 25, 50, 100, "All"] ]
} );
});
});
Maybe somebody is as autistic as me and finds this usefull :P.