Hi,
I had a javascript snippet which checked what radmenu item was selected then it asked an "are you sure" radconfirm box. Since migrating over to the new version (and changing some of the code as per the demo version) the rad confirm will open but then immeditely close without user intervention and continue on the ASP code. The only other thing which is different is I am now using masterpages so I have tried putting my javascript inside a radcode block but no joy.
Here is the stages it used to do correctly:
1. User clicks on menu item.
2. Javascript identifies if the menu item needs an are you sure.
3. If the menu item is to be using a rad confirm perform radconfim
4. If user clicks on "NO" then stop.
5. If user clicks on "Yes" then c# code continues in the radmenu_click event.
Here is whats happening currently:
1. User clicks on menu item.
2. Javascript identifies if the menu item needs an are you sure. (i have added an alert command to ensure the javascript is being hit)
3. Radconfirm appears for no more than 1 second then closes
4. c# code on radmenu continues.
From my testing this is something to do with radconfirm. Can any one help? Below is the javascript and snippet of ASP code:
ASP
c#
JavaScript
Thanks in advance,
Jon
I had a javascript snippet which checked what radmenu item was selected then it asked an "are you sure" radconfirm box. Since migrating over to the new version (and changing some of the code as per the demo version) the rad confirm will open but then immeditely close without user intervention and continue on the ASP code. The only other thing which is different is I am now using masterpages so I have tried putting my javascript inside a radcode block but no joy.
Here is the stages it used to do correctly:
1. User clicks on menu item.
2. Javascript identifies if the menu item needs an are you sure.
3. If the menu item is to be using a rad confirm perform radconfim
4. If user clicks on "NO" then stop.
5. If user clicks on "Yes" then c# code continues in the radmenu_click event.
Here is whats happening currently:
1. User clicks on menu item.
2. Javascript identifies if the menu item needs an are you sure. (i have added an alert command to ensure the javascript is being hit)
3. Radconfirm appears for no more than 1 second then closes
4. c# code on radmenu continues.
From my testing this is something to do with radconfirm. Can any one help? Below is the javascript and snippet of ASP code:
ASP
| <telerik:RadMenu ID="rmReceipt" Style="z-index:1000;" runat="server" ClickToOpen="True" Skin="Telerik" OnItemClick="rmReceipt_ItemClick" OnClientItemClicking="onClicking"> |
| <CollapseAnimation Duration="200" Type="OutQuint" /> |
| <Items> |
| <telerik:RadMenuItem runat="server" Text="Options"> |
| <Items> |
| <telerik:RadMenuItem runat="server" Text="Cancel"> |
| </telerik:RadMenuItem> |
| <telerik:RadMenuItem runat="server" Text="Update And Finish Later"> |
| </telerik:RadMenuItem> |
| <telerik:RadMenuItem runat="server" Text="Print And Complete"> |
| </telerik:RadMenuItem> |
| </Items> |
| </telerik:RadMenuItem> |
| </Items> |
| </telerik:RadMenu> |
| protected void rmReceipt_ItemClick(object sender, RadMenuEventArgs e) |
| {switch (e.Item.Text) |
| { |
| case "Print And Complete": |
| .... |
| RadWindow3.Title = "Receipt"; |
| RadWindow3.ReloadOnShow = true; |
| RadWindow3.VisibleOnPageLoad = true; |
| RadWindow3.Visible = true; |
| RadWindow4.Visible = false; |
| RadWindow2.Visible = false; |
| RadWindow1.Visible = false; |
| //produce receipt |
| break; |
| default: |
| break; |
| } |
| } |
JavaScript
| <script type="text/javascript"> |
| var itemClicked = null; |
| function HideMe(dockableObject, command) |
| { |
| dockableObject.Hide; |
| } |
| function onClicking(sender, eventArgs) |
| { |
| var item = eventArgs.get_item(); |
| if(item.get_text() == "Print And Complete") |
| { |
| alert ("Hello"); //Added to check that javascript is firing |
| itemClicked = eventArgs.get_item(); |
| radconfirm('Printing The Receipt Will Lock The LPG Equipment Details And Receipt. Please Ensure All Details Are Correct Before Proceeding. Do You Wish To Continue?',callBackFn ,500,200,'','Warning!'); |
| return false; |
| } |
| } |
| function callBackFn(result) |
| { |
| if (result) //submit the item |
| { |
| eval(itemClicked.get_navigateUrl()); |
| } |
| } |
| </script> |
Thanks in advance,
Jon