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

2 posts, 0 answers
  1. Reini
    Reini avatar
    16 posts
    Member since:
    Apr 2007

    Posted 08 Sep 2009 Link to this post

    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 :-)
  2. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 09 Sep 2009 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top