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

TrackChanges Poor Performance

1 Answer 53 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Rory
Top achievements
Rank 1
Rory asked on 13 Apr 2010, 07:11 PM
Hello,
We are using the code below to Hide / Show MenuItems when a grid item is selected. We noticed the RadMenu.TrackChanges / RadMenu.CommitChanges is a huge hit on performance and seems to get worse the more times it is called untill the page just eventually freezes. Any clues as to whether this is a memory leak or what?

function FilterGridMenu(commands, primaryKeyID, claimID, claimantID, claimNumber, jurisdiction, attachmentModuleName)  
{  
    var gridMenu = $find("<%= rmGridActions.ClientID %>");  
    if(gridMenu.get_enabled())  
     {  
        //gridMenu.trackChanges();  //COMMENTED OUT BECAUSE ITS A HUGE MEMORY HOG  
              
        //Reset GridMenu Items and Values  
        var menuItems = gridMenu.get_allItems();  
        for (var i=0; i < menuItems.length; i++)  
        {  
            if(menuItems[i].get_text() != 'Grid Actions')  
            {  
                 menuItems[i].hide();  
                 menuItems[i].set_value(primaryKeyID);  
             }  
                          
            var menuItemText = menuItems[i].get_text();  
            if(menuItemText == 'Object Payment')  
            {  
                var paramValue = primaryKeyID + '|' + claimID + '|' + claimantID + '|' + claimNumber + '|' + jurisdiction;  
                menuItems[i].set_value(paramValue);  
            }  
            else if(menuItemText.indexOf('Add') > -1 && menuItemText.indexOf('Attachment'))  
            {  
                var paramValue = attachmentModuleName + '|' + primaryKeyID + '|' + claimantID + '|' + claimNumber;  
                menuItems[i].set_value(paramValue);  
            }  
        }  
                      
        //Apply Commands list to hide or disable Context Menu Items  
        var arrayCommands = commands.split('|');  
        for (x in arrayCommands)  
        {  
           var menuText = arrayCommands[x];  
           if(menuText.length > 0)  
           {  
               var menuItem = gridMenu.findItemByText(menuText);  
               if(menuItem != null)  
               {  
                  menuItem.show();  
               }  
           }  
        }  
        //gridMenu.commitChanges(); //COMMENTED OUT BECAUSE ITS A HUGE MEMORY HOG  
    }  
}            

1 Answer, 1 is accepted

Sort by
0
T. Tsonev
Telerik team
answered on 14 Apr 2010, 08:55 AM
Hi Rory,

This behavior is by design - calling trackChanges/commitChanges will log all operations, so the menu can be restored in its last state on the server. If you don't need to persist the state of the menu to the server then then you don't need to call this methods. The performance will be much better as a result.

I hope this helps.

Greetings,
Tsvetomir Tsonev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Menu
Asked by
Rory
Top achievements
Rank 1
Answers by
T. Tsonev
Telerik team
Share this question
or