Link to home
Start Free TrialLog in
Avatar of curiouswebster
curiouswebsterFlag for United States of America

asked on

jQuery: Disabling tab switching

My tab controls are defined thusly:

            $('<ul>',
                {
                    'class': 'nav nav-tabs cs-tabs',
                    'data-max-nbr-lists': self.options.maxNbrLists,
                    'on': {
                        'show.bs.tab': function(event) {
                            self.onTabShow(event, self);
                        }
                    },
                    'append': $('<li>',
                        {
                            'class': 'cs-tab active',
                            'append': $('<a>',
                                {
                                    'data-toggle': 'tab',
                                    'data-action': 'Create',
                                    'data-id': 0,
                                    'data-name': 'Create New List',
                                    'html': 'Create New List'
                                })
                        })
                }),

Open in new window


so inside the following function, I get  the notification of a change to the tab  sselection:

configSelectorDialog.prototype.onTabShow = function (event, widget) {
}

but inside that function, I need to be able to abort the change to selected tab

How can I do this?

I have a local variable which contains the bool status of whether there have been changes, or not.

If changes made, I display a pop-up and need to cancel the tab selection change.

Thanks
ASKER CERTIFIED SOLUTION
Avatar of Mrunal
Mrunal
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of curiouswebster

ASKER

thanks