Laravel 8 Datatables Keeping Selected Page Number

$('#example').dataTable( {
stateSave: true,
stateDuration:-1
} );
$('#example').dataTable( {
"stateSave": true,
"stateDuration": 60 * 60 * 24
});
$('#example').dataTable( {
stateSave: true,
stateSaveCallback: function(settings,data) {
localStorage.setItem( 'DataTables_' + settings.sInstance, JSON.stringify(data) )
},
stateLoadCallback: function(settings) {
return JSON.parse( localStorage.getItem( 'DataTables_' + settings.sInstance ) )
}
} );
table.row(index).data(data).draw(false)
var table = $("#table").DataTable();
table.ajax.reload(null, false);

--

--

--

I am Laravel and PHP Developer. I have also Good Knowledge of JavaScript, jQuery, Bootstrap and REST API.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

JavaScript Callbacks & Promises

How do I setup a SSL certificate for an express.js server?

How to setup & use Redux in ReactNative app in 15 steps

JavaScript Concept

All you need to know about React.

The Component as the Unit of Composition (Part 2)

Developer Diaries E03

First Steps with Koa js

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Websolutionstuff

Websolutionstuff

I am Laravel and PHP Developer. I have also Good Knowledge of JavaScript, jQuery, Bootstrap and REST API.

More from Medium

Custom Notification in Laravel — StudySection Blog

Custom Notification in Laravel — StudySection Blog

Writing WordPress REST API Endpoints Like Laravel Code

How To Register Custom Validation Rule in Laravel 8

WHY TO CHOOSE LARAVEL FRAMEWORK FOR WEB DEVELOPMENT