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

Formatting menu text

4 Answers 17 Views
Menu
This is a migrated thread and some comments may be shown as answers.
James
Top achievements
Rank 1
James asked on 10 Dec 2016, 07:10 AM

 

I have been trying to create menu items that contain text for the menu item plus text for the shortcut key for that item. 

what I would like is for the menuText to be left aligned and the shortcutText to be right aligned. Is that at all possible to achieve?

 mnuObj = { text: '<span id=' + menuId + ' data-id=' + dataId + '>' + menuText + shortcutText + '</span>', encoded: false, imageUrl: imgFolderPath + menuImage };

 

What I am doing at the moment is prefixing a variable number of '&nbsp;'s  to the shortcutText based on the number of characters in menuText but the result is not very good.

 

Thanks

Jim

4 Answers, 1 is accepted

Sort by
0
Danail Vasilev
Telerik team
answered on 13 Dec 2016, 11:59 AM
Hi Jim,

Can you send us a fully runnable dojo sample that shows how the menu is declared? You can use for exmaple one of the following dojo samples - http://demos.telerik.com/kendo-ui/menu/index

Regards,
Danail Vasilev
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
James
Top achievements
Rank 1
answered on 13 Dec 2016, 12:58 PM

Hi Danail

I have created a simplified menu here: http://dojo.telerik.com/EFAcE

What I am trying to find out is whether it is possible to align the second piece of text - the shortcut eg Ctrl+O to the right of the menu so that when you open a menu all the short cuts line up neatly.

 

Thanks

Jim

0
James
Top achievements
Rank 1
answered on 14 Dec 2016, 08:07 AM

Hi Danail

 

I have found a solution - I created 2 more spans to hold the two pieces of menu text., the first styled as an inline block with a fixed length. The second piece of text (the shortcut keys) is now correctly aligned.

Thanks

Jim

0
Danail Vasilev
Telerik team
answered on 14 Dec 2016, 03:15 PM
Hello Jim,

I am glad you have managed to solve the issue. Let us know if you need any assistance with our products.

Regards,
Danail Vasilev
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Menu
Asked by
James
Top achievements
Rank 1
Answers by
Danail Vasilev
Telerik team
James
Top achievements
Rank 1
Share this question
or