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

Multi column menu via templates - width of 'rmSlide' always fixed

1 Answer 99 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Reini
Top achievements
Rank 2
Reini asked on 08 Sep 2009, 08:07 AM
hi dear telerik team, hi dear community!

i'm haveing a serious problem here - let me explain:

i'm creating a multi column menu, horizontal radMenu with normal dropdown flyouts that use dynamically loaded templates. that works fine so far :-)

now i have some menus that have 3 colums, some have 2 and some only 1. in the original settings the rmSlide somehow gets dynamically a width set to about 138px - which of course causes my columns to wrap and align under each other - not what was my intention.....
now i did set the width for rmSlide to 600px !important - which works fine for my 3 column menu - but of course makes problems with the ones that have less, as it streches out of the window to the right - especially for the last item to the far right, that makes the browser window to show scrollbars at the bottom as it is 'magically' now much wider then the shown area.

the template inside the rmSlide itself is a table - that stretches to the correct width of the columns.

what i would need is a possibility to tell rmSlide to have a width of 'auto' or no fixed width at all - but that does not work.....
possibly i could set the width dynamically with javacript, but i have no clue how to get the actual width of my 'dynamic' table....
what can i do?

after all - even the 'hack' i described above works in ff & ie8, in ie6 it looks horrendous as it somehow looses all the inner content of my menu and flys around the pages rather unpredictable....

please help me!!
thank you :-)

1 Answer, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 09 Sep 2009, 01:33 PM
Hello Reini,

I suggest you subscribe to OnClientItemOpened event and set the with of "rmSlide" element in its handler like this:

<script type="text/javascript"
    function itemOpened(sender, args) { 
       var table = args.get_item().get_items().getItem(0).get_element().firstChild.firstChild; 
       if(table) 
        args.get_item()._slideWrapElement.style.width = table.clientWidth + "px"
    } 
</script> 

If this doesn't help, please open a support ticket and send us a simple page illustrating the issue there so we to be able to test it.

Kind regards,
Yana
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Menu
Asked by
Reini
Top achievements
Rank 2
Answers by
Yana
Telerik team
Share this question
or