jQuery UI Widgets Forums Navigation Tabs Prevent tab close

This topic contains 12 replies, has 6 voices, and was last updated by  fdski 9 years, 2 months ago.

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
  • Prevent tab close #52943

    sinch
    Participant

    Hello,

    I’m just learning to use jqWidgets, and I have a problem for what I don’t find any solution.
    I want to prevent the closing of a certain tab in case of:
    #1. the user clicks on a tab to activate it, but it hits the close button by accident
    #2. I have a form in a tab which is modified but not yet saved.
    Is there any event that fires before the tab being closed so that I can prevent the closing?

    Thanks.

    Prevent tab close #52949

    Dimitar
    Participant

    Hello flevi,

    Unfortunately, there is no such event in the jqxTabs API.

    Best Regards,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/

    Prevent tab close #53022

    sinch
    Participant

    Any plans to add such an event in the near future?

    Thank you.

    Prevent tab close #53028

    Dimitar
    Participant

    Hi flevi,

    We currently have no plans to add this functionality.

    Best Regards,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/

    Prevent tab close #53033

    fox82i
    Participant

    Hi flevi,
    I’ve similar problem… I suggest to you to implemente a javascript function to prevent this kind of problem..

    Prevent tab close #53045

    sinch
    Participant

    Hi Dimitar, fox82i,
    I did try to put an onclick on the div that stands for the close button, but of course the tabs method runs first … so I have no solution to solve this, and I would need this framework for a big system where every form/grid/whatever is opened in a new tab (and the number of opened tabs will constantly exceed 20-25, so constantly navigating between that many tabs will easily result in accidentally closing a tab, instead of selecting it – and loosing unfinished forms is a problem), so this is a big issue for me … I guess I will either use the jQuery UI tab, or implement a custom tab script. If you have any easy solution I would appreciate it. Thanks again.

    Prevent tab close #53050

    fox82i
    Participant

    Flevi,
    wait me I come from other framework and I discovered this recently.
    I need to study before to produce somenthing

    Prevent tab close #53144

    mg
    Participant

    I have the same problem, but i solved with a little trick:

    1. Attach to mousedown event of .jqx-tabs-close-button. I call jqxTabs addLast method first, then i call jquery mousedown method.
    2. On mousedown event, for example do:

    if (confirm(“Close?”)) {
    $(this).trigger(‘click’);
    return true;
    }
    return false

    Works for me!
    MG

    Prevent tab close #53158

    sinch
    Participant

    Thanks mg, it works.

    Prevent tab close #53193

    mg
    Participant

    Great!, sometimes i love jqwidgets but other times i feel frustrated when i read: “We currently have no plans to add this functionality” many times i resolved problems like that with hacks and tricks. jqwidgets is a very good library but sometimes i feel frustrated….

    Prevent tab close #55111

    howe
    Participant

    Hello,

    I’m a bit too late in this thread, but here comes my solution: I added a “beforeClose” event. If it returns false, tab closing is prevented.
    Example has both initially rendered and dynamically created tabs.

    http://jsfiddle.net/howe/HzJ73/

    Best Regards,
    Howe

    Prevent tab close #55132

    howe
    Participant

    Btw I meant “beforeRemove” event.

    Howe

    Prevent tab close #73802

    fdski
    Participant

    howe, i love you man (or woman) !!!

    🙂

    Thanks.

    B

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

You must be logged in to reply to this topic.