Opened 15 years ago

Closed 15 years ago

Last modified 10 years ago

#2838 closed enhancement (worksforme)

There should be a method to remove all the tabs from ui.tabs

Reported by: sjmittal Owned by: klaus.hartl
Priority: minor Milestone:
Component: ui.tabs Version: 1.5
Keywords: ui.tabs Cc:
Blocked by: Blocking:

Description

Hi, There is a need to remove all the tabs from ui.tabs without destroying the tabs. The function name should be removeAll This is the code I propose:

removeAll: function() {

var len = this.length(); for(var index = 0; index < len; index++) {

var $li = this.$lis.eq(index).remove(), $panel = this.$panels.eq(index).remove();

}

this.tabify();

}

If found appropriate please include it in the code.

Thanks Sachin

Change History (8)

comment:1 Changed 15 years ago by flesler

Owner: changed from paul to klaus

comment:2 Changed 15 years ago by (none)

Milestone: 1.2.4

Milestone 1.2.4 deleted

comment:3 Changed 15 years ago by paul

Component: ui.coreui.tabs
Version: 1.2.31.5b4

comment:4 Changed 15 years ago by paul

Owner: changed from klaus to klaus.hartl
Status: newassigned

comment:5 Changed 15 years ago by klaus.hartl

Priority: majorminor
Version: 1.5b41.5

comment:6 Changed 15 years ago by Cloudream

Milestone: TDB

comment:7 Changed 15 years ago by klaus.hartl

Resolution: worksforme
Status: assignedclosed

I'd rather suggest to pass an array instead of a single index to the remove method. Same for disable/enable. I thought about adding this functionality the other day, but I'm not quite sure about making the API more difficult.

Apart from that, as jQuery itself, Tabs are easily extensible and thus I don't see the need to add this function to the core.

$.extend($.ui.tabs.prototype, {
    removeAll: function() {
        ...
    }
});

comment:8 Changed 10 years ago by Scott González

Milestone: TBD

Milestone TBD deleted

Note: See TracTickets for help on using tickets.