TransWikia.com

How to know and appoint to last position after success event ajax?

Stack Overflow Asked by mastersuse on December 22, 2021

Current situation, when task/activity is successfully added, the page will reload go to main project page.

Suggestion to straight away show the successfully added task/activity so user can verify immediately and add the next activity within the same task. This can save time for user add activity , currently need to scroll and find back the tasks/activity to verify and add more.

The question, it is possible to do that? If yes, what is the best keyword or term to google it. Need advise.

In my case, I have datatable that allow user to edit using modal. After the success event, the statement above need to be done.

$('#successModal').on('hidden.bs.modal', function(e) {
    $('#editModal').modal('hide');
    $('#projectDetail2').empty(); loadtable();
});

UPDATE

I have use scrollTop to get the top value and store in localStorage. But when load the page it is not function. I doing like this.

$(document).ready(function(){
    loadtable();
});

function loadtable(){
    if (localStorage.top != 0){
        $(document).scrollTop(localStorage.top);
    }
    else {
        localStorage.top = $(document).scrollTop();

        $.ajax({...});
    }
}

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP