Speed up database updates by using a transaction
Use JQuery library
Change view mode in pure JavaScript
Include modulekit-ajax library
Update view mode via ajax-call