This is a migrated thread and some comments may be shown as answers.

Collapsible Tabs

4 Answers 185 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Angelo
Top achievements
Rank 1
Angelo asked on 03 Nov 2011, 08:14 PM
I like the sleek look of your Tabstrip so much more than jQueryUI's version, but I'm having trouble getting a tab to collapse after it's been clicked and is currently active. I'd hate to pry too much into the code behind it, but what I've found is that if that functionality would exist, it would be in this section:
 M = j.extend({
...
           
_click: function(b) {
                var c = this,
                    d = a(b.currentTarget),
                    e = d.find("." + n),
                    f = e.attr(m),
                    g = a(c.contentElement(d.index()));
                if(d.is("." + D + ",." + F)) {
// NOTE: Prevent animation of same selected tab
                    b.preventDefault();
                } else {
                    if(a("." + v, this.element).filter(function() {
                        return a(this).data("animating")
                    }).length) {return;}
                    if(c.trigger(u, {
                        item: d[0],
                        contentElement: g[0]
                    })) {b.preventDefault();
                    } else {
// NOTE: Animate change of tab
                        var h = e.data(w) || f && (f.charAt(f.length - 1) == "#" || f.indexOf("#" + c.element[0].id + "-") != -1);
                        if(!f || h) b.preventDefault();
                        else return;
                        c.activateTab(d) && b.preventDefault()
                    }
                }
            }

Has anyone accomplished this? I'd hate to break the code by adding my own.

4 Answers, 1 is accepted

Sort by
0
Kamen Bundev
Telerik team
answered on 04 Nov 2011, 01:20 PM
Hello Angelo,

I went ahead and directly implemented this feature, it will be available with the next release. I'm attaching a patch for the non-minified TabStrip. After applying it, you will only need to init it with the option collapsible: true.

All the best,
Kamen Bundev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Angelo
Top achievements
Rank 1
answered on 04 Nov 2011, 04:08 PM
Works like a charm. Good work!

However, I found that if you have nested tabs and apply collapsible:true to the outer tabstrip, clicking on items in the inner tabstrip will close the outer tabstrip. I'm pretty sure I can come up with a workaround for this, so it's not too pressing of an issue.
0
Kamen Bundev
Telerik team
answered on 08 Nov 2011, 08:35 AM
Hi Angelo,

I wasn't able to reproduce your issue, maybe it has something to do with your specific use case. Can you send me a code sample of the 2 TabStrips?

Greetings,
Kamen Bundev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Angelo
Top achievements
Rank 1
answered on 08 Nov 2011, 05:02 PM
Not a problem anymore. Got it working!

Thanks for the follow-up.
Tags
TabStrip
Asked by
Angelo
Top achievements
Rank 1
Answers by
Kamen Bundev
Telerik team
Angelo
Top achievements
Rank 1
Share this question
or