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?
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 |
| } |
| } |