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

[Solved] Client ExpandAll ??

4 Answers 130 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Joan Vilariño
Top achievements
Rank 2
Joan Vilariño asked on 26 Apr 2010, 04:05 PM
Hi. I've been trying but I'm unable to find a client-side "ExpandAll" for your TabPanel.

For the moment, I'm using this:

        var panel = $('#myPanel').data("tPanelBar"); 
        for (i = 0; i < 3; i++) { 
            var item = $('> li', panel.element)[i]; 
            panel.expand(item); 
        } 

... for my 3 fixed tabs panel, but I think it would be cool that you could do:

        $('#myPanel').data("tPanelBar").expandAll(); 

Will you implement this in future releases??

Thanks!

4 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 26 Apr 2010, 04:17 PM
Hi Joan Vilariño,

You can reduce your code to:

$('#myPanel').data("tPanelBar").expand('#myPanel > li');

The expand method accepts DOM elements, jQuery objects and valid jQuery selectors.

Regards,
Atanas Korchev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Joan Vilariño
Top achievements
Rank 2
answered on 26 Apr 2010, 04:36 PM
Thanks! Will do...
0
reidfenn
Top achievements
Rank 1
answered on 27 Jun 2012, 09:25 PM

Solution 1 suggested by support does not work.

function PanelBar_onLoad(e) {
    //alert('PanelBar_onLoad');
    //`this` is the DOM element of the grid
    $('#LayoutLeftMenu').data("tPanelBar").expand('#LayoutLeftMenu > li');
}

Solution 2 looping recursively through the panel bar also does not work. 

function getPanelBar()
{
    var panelbar = $("#LayoutLeftMenu").data("tPanelBar");
    return panelbar;
}
 
function PanelBar_onLoad(e) {
    //alert('PanelBar_onLoad');
    //`this` is the DOM element of the grid
    var panelBar = getPanelBar();
    ExpandPanelbar(panelBar, panelBar.element);
}
 
function ExpandPanelbar(panelBar, items)
    for (var i=0; i<items.childElementCount; i++)
    {
        var item = items.childNodes[i];
        panelBar.enable(true);
        panelBar.expand(item);
        if (panelBar.element.childElementCount > 0)
            ExpandPanelbar(panelBar, panelBar.element);
     }
}

Please help!!!
Thanks

0
pawan
Top achievements
Rank 1
answered on 06 Jun 2013, 11:10 AM
can try this on OnLoad of the panel bar -

$('.t-panelbar-expand').click()
Tags
PanelBar
Asked by
Joan Vilariño
Top achievements
Rank 2
Answers by
Atanas Korchev
Telerik team
Joan Vilariño
Top achievements
Rank 2
reidfenn
Top achievements
Rank 1
pawan
Top achievements
Rank 1
Share this question
or