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

Tooltips within PanelBar

4 Answers 60 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.
Rob
Top achievements
Rank 1
Rob asked on 27 Sep 2011, 04:03 PM
I wish to add tooltips to the items in the PanelBar and to the sub items.  Within HTML I know I need the 'title' attribute, but this doesn't seem available, plus I haven't seen any examples in the forums previously.

Could someone please point me in the right direction?

Thanks,
Rob.

4 Answers, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 28 Sep 2011, 08:35 AM
Hi Rob,

The title attribute can be set via HtmlAttributes of the respective PanelBar item.

item.Add()
     .Text("item text")
     .HtmlAttributes(new { title = "item title" })


Best wishes,
Dimo
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now
0
Rob
Top achievements
Rank 1
answered on 28 Sep 2011, 09:19 AM
Perfect,

Thanks Dimo!

Rob.
0
Clinton Smyth
Top achievements
Rank 1
answered on 04 Feb 2013, 07:56 PM
Hi

How can we do this on the html/javascript level?

I tried adding "attributes: { 'title': 'item mouse over' }" as below  (which I've used with other kendoui widgets) 
but to no avail.


$("#mainPanelBar").kendoPanelBar({
            dataSource: [
                {
                    text: "Item 1",
                    url: "http://www.kendoui.com/",          // link URL if navigation is needed (optional)
                    attributes: { 'title': 'item mouse over' },
                    items: [{                                // Sub item collection.
                        text: "Sub Item 1"
                    },
                    {
                        text: "Sub Item 2"
                    }]
                },
                {
                    text: "Item 5",
                    // item image sprite CSS class, optional
                    spriteCssClass: "imageClass3"
                }
            ]
        });

0
Dimo
Telerik team
answered on 05 Feb 2013, 09:56 AM
Hello Clinton,

The ability to declaratively set custom HTML attributes to Kendo UI PanelBar items exists only in the MVC wrapper of the widget, in order to ensure backwards compatibility with the old MVC PanelBar. In this case the items are rendered server-side. When using the pure client-side Kendo UI PanelBar, you have two options:

1) add the title to the raw HTML output, which is used to initialize a PanelBar widget. This may not be applicable to your scenario if the items are created from a datasource.

or

2) add the title with Javascript and standard DOM manipulation methods after the widget has been initialized.

Regards,
Dimo
the Telerik team
Check out the successor of Telerik MVC Extensions - Kendo UI for ASP.NET MVC - and deem it for new ASP.NET MVC development.
Tags
PanelBar
Asked by
Rob
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Rob
Top achievements
Rank 1
Clinton Smyth
Top achievements
Rank 1
Share this question
or