Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Div Block call works perfectly on the first ajax call. After show/hides on divs it doesn't block during 2nd ajax call #131

Open
sarobinson9535 opened this issue Feb 20, 2016 · 0 comments

Comments

@sarobinson9535
Copy link

I've been struggling with this for a bit and haven't been able to find a solution.

Scenario:
I have a page with multiple divs. The workflow has been built by "showing and hiding" the appropriate div.

The div level block call works perfectly the first time you select from the list page and the ajax call is made to retrieve the information for the entry selected. The callback function executes the unblock, again perfectly, and the first page of the workflow is shown.

If you navigate "back" to the original list page and select the same element again, the same calls are made, but this time the block command doesn't show anything on the list page. The only time you see the block is a split second AFTER the 1st page in the workflow is rendered.

Below are the two functions I am working with to solve this issue (which repeats in all the pages built in this fashion).

Hoping it is just something easy I'm missing.

Generic representation of Page Divs are:

<div id="edit">
    <div id="page1">
    </div>

    <div id="page2">
    </div>
    
</div>

Functions in question:

function editInformation(selectedId)
{
    selected = selectedId;
    var data = { token: token }

    $('#mainBox').block({ message: '<span class="ion-loading-c myIon"></span><h4 class="loadingMsg">Loading</h4>', css: { border: 'none', backgroundColor: 'transparent', display: 'block'} });

    $.post(url + '/info', data, function(resp)
    {
        $('#mainBox').unblock();

        if(resp['resflag'] == true)
        {
            $('#list').hide();
            $('#edit').show();
            $('#page1').show();   
        }
        else
        {
            //error logic
        }
    });
}

$('#backToListing').click(function()
{
    $('#edit').hide();
    $('#page1').hide();
    $('#list').show();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant