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

RADMenu Item Hide issue

3 Answers 70 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Sumit Mittal
Top achievements
Rank 1
Sumit Mittal asked on 26 Nov 2009, 11:28 AM

Hi

I am having a RADMenu in which i am having many items.
RadMenu.DefaultGroupSettings.Height = Unit.Pixel(100) property set in order to fix scroll after that hieght.

After i  hide some top items in JS my other items are hanged in space.

Find attached Screen shot.


Thanks
Sumit Mittal

3 Answers, 1 is accepted

Sort by
0
Paul
Telerik team
answered on 27 Nov 2009, 02:48 PM
Hi Sumit,

Could you please paste here some code snippet that shows how exactly teh manu is defined and how you remove the items?

Thanks,
Paul
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.
0
Sumit Mittal
Top achievements
Rank 1
answered on 30 Nov 2009, 05:32 AM

Hi Paul,

I am creating dynamic RadMenu and adding to RadToolBar

//At Page_Load

 

RadMenu objRadMenu =

new RadMenu();

 

objRadMenu.ID =

"objMenu";

 

objRadMenu.DefaultGroupSettings.Height =

Unit.Pixel(100);

 

objRadMenu.OnClientItemClicked =

"MenuItemClicked";

 

objRadMenu.EnableEmbeddedSkins =

false;

 

objRadMenu.Skin =

"TopNavigation";

 

objRadMenu.EnableRootItemScroll =

true;

 

objRadMenu.EnableAutoScroll =

true;

 

//Code to Add MenuItem (Not Pasted)

//JS Code to remove

 

var

 

toolBar = window.parent.$find("_ctl0_rtbMenuBar_i0_objMenu");

 

 

if(toolBar!=null)

 

{     

 

    var menuRollBackLength = toolBar._findItemByAttribute("MenuTypeID",36)._getAllItems().length;

 

 

    var menuRollBackArray = toolBar._findItemByAttribute("MenuTypeID",36)._getAllItems();//Column Array

 

 

 

 

 

 

 

    

 

 

 

    for(var i=0; i< menuRollBackLength; i++)

 

    { 
       //Depending on some logic i hide items

 

 

        if(tempThemeID != ThemeID.value )

 

        {

            menuRollBackArray[i].set_visible(

false);

 

        }

 

        else

 

 

 

 

        {

            menuRollBackArray[i].set_visible(

true);

 

        }

}

 

 

toolBar.commitChanges();

 

 


 

 

0
Yana
Telerik team
answered on 01 Dec 2009, 03:41 PM
Hello Sumit,

Please call the following method for the parent item which contains the hidden items:

parent._updateScrollWrapSize();
parent._slide.updateSize();
parent._positionChildContainer();

I've attached my test page for a reference.

All the best,
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
Sumit Mittal
Top achievements
Rank 1
Answers by
Paul
Telerik team
Sumit Mittal
Top achievements
Rank 1
Yana
Telerik team
Share this question
or