TrackChanges Poor Performance

2 posts, 0 answers
  1. Rory
    Rory avatar
    159 posts
    Member since:
    Jul 2007

    Posted 13 Apr 2010 Link to this post

    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 %>");  
            //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')  
                var menuItemText = menuItems[i].get_text();  
                if(menuItemText == 'Object Payment')  
                    var paramValue = primaryKeyID + '|' + claimID + '|' + claimantID + '|' + claimNumber + '|' + jurisdiction;  
                else if(menuItemText.indexOf('Add') > -1 && menuItemText.indexOf('Attachment'))  
                    var paramValue = attachmentModuleName + '|' + primaryKeyID + '|' + claimantID + '|' + claimNumber;  
            //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)  
            //gridMenu.commitChanges(); //COMMENTED OUT BECAUSE ITS A HUGE MEMORY HOG  
  2. T. Tsonev
    T. Tsonev avatar
    2829 posts

    Posted 14 Apr 2010 Link to this post

    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.

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