Formatting menu text

5 posts, 0 answers
  1. James
    James avatar
    6 posts
    Member since:
    Feb 2014

    Posted 10 Dec 2016 Link to this post

     

    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

  2. Danail Vasilev
    Admin
    Danail Vasilev avatar
    1502 posts

    Posted 13 Dec 2016 Link to this post

    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.
  3. James
    James avatar
    6 posts
    Member since:
    Feb 2014

    Posted 13 Dec 2016 in reply to Danail Vasilev Link to this post

    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

  4. James
    James avatar
    6 posts
    Member since:
    Feb 2014

    Posted 14 Dec 2016 in reply to James Link to this post

    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

  5. Danail Vasilev
    Admin
    Danail Vasilev avatar
    1502 posts

    Posted 14 Dec 2016 Link to this post

    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.
Back to Top