jQWidgets Forums

jQuery UI Widgets Forums Dialogs and Notifications Window dynamic window not closing

Tagged: 

This topic contains 4 replies, has 2 voices, and was last updated by  Peter Stoev 12 years, 3 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
  • dynamic window not closing #16545

    rajuk
    Member

    creating a model window dynamically and I am trying to remove the window with id its not working.

    steps
    1.create window structure
    2.assign widget and it is working perfectly, I am getting modal window.
    3.later trying to close from the API using widow id, there comes the problem.

    how can i close it by API?

    dynamic window not closing #16557

    Peter Stoev
    Keymaster

    Hi rajuk,

    Please, provide a sample which demonstrates your issue.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    dynamic window not closing #16575

    rajuk
    Member
    var mywindow=$("<div><div>heading</div><div>content<button id='closebtn'>Close window</button></div>").appendTo("#container").attr("id","windowid");
    mywindow.jqxWindow({
    isModal:true,
    closeButtonAction:"close"});
    $("#closebtn").bind("click",function(){$("#windowid").jqxWindow('close');});
    dynamic window not closing #16578

    rajuk
    Member

    Sorry about my last post it has some errors.

    //window initialization
    var mywindow=$("<div/>")
    .append("<div>heading</div><div>content<button id='closebtn'>Close window</button></div>")
    .appendTo("#container")
    .attr("id","windowid");
    //getting window
    mywindow.jqxWindow({
    isModal:true,
    close:closeCallback,
    closeButtonAction:"close"});
    //trying to close using api
    $("#closebtn").bind("click",function(){
    $("#windowid").jqxWindow('close');
    });
    function closeCallback(){
    //callback invoked.
    }

    the window not closing but invoking callback.

    how to resolve it?

    dynamic window not closing #16595

    Peter Stoev
    Keymaster

    Hi rajuk,

    The problem is that you override the “close” method by doing this:

    close:closeCallback

    Remove that line and it will work.

    If you want to catch the “close” event, you should do this:

    $("#window").on('close', function(event)
    {
    });

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.