I was wondering if anyone had code for when loading a page for it to load on the bottom/end of the page. I have an invoice system so everytime they add an item it add to the bottom but refreshes and loads at the top. I have a scroll to bottom button but haven’t been able to figure out code for this. Thank you all in advance.
/* Close Form on Submit*/
$(document).on('knack-form-submit.view_375', function (event, view, record) {
Knack.closeModal()
})
/* When Submitted Form closes, fetch / refresh table*/
$(document).on('knack-form-submit.view_375', function(event, view, record) {
Knack.views["view_140"].model.fetch();
});
Watch the video for comprehensive instructions. All credit to @CarlHolmes for this video!
Hopefully the below will help. I’m not a coder so I’m sure there is a better way, but it works for me.
Add this to your JavaScript section
//Scroll to bottom of page on page load
$(document).on('knack-scene-render.scene_77', function(event, scene) { // change scene number as required
$('html, body').animate({ scrollTop: $(document).height() }, 'fast');
});
Hello Carl, this helped a bunch, turns out what I ended up doing was making some adjustments due to long page loading shifting at the end. The code I ended with was: