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

PanelBar does not select properly

1 Answer 70 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Eric
Top achievements
Rank 1
Eric asked on 10 Jan 2013, 03:50 PM
<ul id="panelbar">
    <li class="k-state-active">
        Vendors
        <ul>
                <li class="k-state-selected" ><span onclick="SetVendorID(1)">Vendor 1</span></li>
                <li><span onclick="SetVendorID(1)">Vendor 2</span></li>
       </ul>     
    </li>
</ul>

This selects the first item in the list but only highlights the text not the background of the item like it does when you click on it.

When you click on Vendor 2, Vendor 1 does not deselect the text, it stays white when it should be deselected (black).

Why doesn't this work?

1 Answer, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 11 Jan 2013, 08:47 AM
Hello Eric,

Selected items and active items are different things. When you click on a root item, it becomes active and selected at the same time, which is reflected in its appearance. When an item is only active, but not selected, it looks different by design.

Only one item can be selected at a time.

In addition, item selection cannot be controlled declaratively, because the selected class is applied to an element, which is autogenerated by the PanelBar widget and does not exist in the original HTML markup. You need to apply selection with Javascript after width initialization by using the API.

Regards,
Dimo
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
PanelBar
Asked by
Eric
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Share this question
or