This is my first encounter with RadMenu, so I just copied directly from the online example and modified it to fit my column names:
The menu pops up on right mouse-click populated with all the menu items. When I click on a menu item the following javascript is invoked, again copied verbatum from the online example:
And no matter what menu item I click on a get a JavaScript "Property Not Supported" error. The cause of this is apparently
So I commented it out and then all I get is the [undefined] JavaScript error.
Can someone please give me a clue, because I obviously don't have one?
Thanks,
Mark
<telerik:RadContextMenu ID="radContextMenu1" runat="server" Skin="Forest" OnClientItemClicked="ClientItemClicked"> |
<Items> |
<telerik:RadMenuItem Text="Show Column"> |
<Items> |
<telerik:RadMenuItem Text="MDEP" /> |
<telerik:RadMenuItem Text="MDEP Description" /> |
<telerik:RadMenuItem Text="OA" /> |
<telerik:RadMenuItem Text="OA Description" /> |
<telerik:RadMenuItem Text="EOR" /> |
<telerik:RadMenuItem Text="EOR Description" /> |
<telerik:RadMenuItem Text="ASN" /> |
<telerik:RadMenuItem Text="ASN Description" /> |
<telerik:RadMenuItem Text="APC" /> |
<telerik:RadMenuItem Text="APC Description" /> |
<telerik:RadMenuItem Text="FY06" /> |
<telerik:RadMenuItem Text="FY07" /> |
<telerik:RadMenuItem Text="FY08" /> |
<telerik:RadMenuItem Text="FY09" /> |
</Items> |
</telerik:RadMenuItem> |
<telerik:RadMenuItem Text="Hide Column" /> |
</Items> |
<Targets> |
<telerik:ContextMenuTagNameTarget TagName="thead" /> |
</Targets> |
</telerik:RadContextMenu> |
The menu pops up on right mouse-click populated with all the menu items. When I click on a menu item the following javascript is invoked, again copied verbatum from the online example:
function ClientItemClicked( sender, eventArgs ) { |
activeTable = $find( "<%= radGrid1.ClientID %>" ).get_masterTableView(); |
colIndex = GetRealCellIndex( activeTable, eventArgs.get_gridColumn().get_element()); |
switch( eventArgs.get_item().get_text() ) { |
case "MDEP" : |
activeTable.showColumn( 0 ); |
break; |
case "MDEP Description" : |
activeTable.showColumn( 1 ); |
break; |
case "OA" : |
activeTable.showColumn( 2 ); |
break; |
case "OA Description" : |
activeTable.showColumn( 3 ); |
break; |
case "EOR" : |
activeTable.showColumn( 4 ); |
break; |
case "EOR Description": |
activeTable.showColumn( 5 ); |
break; |
case "ASN": |
activeTable.showColumn( 6 ); |
break; |
case "ASN Description": |
activeTable.showColumn( 7 ); |
break; |
case "APC": |
activeTable.showColumn( 8 ); |
break; |
case "APC Description": |
activeTable.showColumn( 9 ); |
break; |
case "FY06": |
activeTable.showColumn( 10 ); |
break; |
case "FY07": |
activeTable.showColumn( 11 ); |
break; |
case "FY08": |
activeTable.showColumn( 12 ); |
break; |
case "FY09": |
activeTable.showColumn( 13 ); |
break; |
case "Hide Column" : |
activeTable.hideColumn( colIndex ); |
break; |
default : |
break; |
} |
} |
And no matter what menu item I click on a get a JavaScript "Property Not Supported" error. The cause of this is apparently
colIndex = GetRealCellIndex( activeTable, eventArgs.get_gridColumn().get_element());
So I commented it out and then all I get is the [undefined] JavaScript error.
Can someone please give me a clue, because I obviously don't have one?
Thanks,
Mark