Hi,
during migration to Infragistics 12.2 from Infragistics 10.3 we have encountered really strange behaviour.
This is a sample ASP.Net page
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Content.aspx.cs" Inherits="WebApplication1.Content" %>
<%@ Register Assembly="Infragistics35.Web.v12.2, Version=12.2.20122.2107, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" namespace="Infragistics.Web.UI" tagprefix="ig" %><%@ Register Assembly="Infragistics35.Web.v12.2, Version=12.2.20122.2107, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" namespace="Infragistics.Web.UI.NavigationControls" tagprefix="ig" %><%@ Register assembly="Infragistics35.WebUI.Misc.v12.2, Version=12.2.20122.2107, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" namespace="Infragistics.WebUI.Misc" tagprefix="igmisc" %><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd"><html xmlns="http://www.w3.org/1999/xhtml" ><head runat="server"> <title></title> <style type="text/css"> body,html{ margin: 0px; padding: 0px; } </style> <script type="text/javascript"> function disable() { var dataMenu = $IG.WebDataMenu.find("WebDataMenu1"); var buttonEdit = dataMenu.getItems().getItem(1); buttonEdit.set_enabled(false); var buttonRemove = dataMenu.getItems().getItem(2); buttonRemove.set_enabled(false); } function enable() { var dataMenu = $IG.WebDataMenu.find("WebDataMenu1"); var buttonEdit = dataMenu.getItems().getItem(1); buttonEdit.set_enabled(true); var buttonRemove = dataMenu.getItems().getItem(2); buttonRemove.set_enabled(true); } </script> </head><body bgcolor="#FFFFFF"> <form id="form1" runat="server"> <div> <ig:WebScriptManager ID="WebScriptManager1" runat="server"> </ig:WebScriptManager> </div> <ig:WebDataMenu ID="WebDataMenu1" runat="server" onitemclick="WebDataMenu1_ItemClick" ActivateOnHover="False"> <Items> <ig:DataMenuItem Key="Add" Text="Add" ToolTip="Add" Value="Add"> </ig:DataMenuItem> <ig:DataMenuItem Key="Edit" Text="Edit" ToolTip="Edit" Value="Edit"> </ig:DataMenuItem> <ig:DataMenuItem Key="Remove" Text="Remove" ToolTip="Remove" Value="Remove"> </ig:DataMenuItem> <ig:DataMenuItem Key="Ok" Text="Ok" ToolTip="Ok" Value="Ok"> </ig:DataMenuItem> </Items> <GroupSettings Orientation="Horizontal" /> </ig:WebDataMenu> <br /> <br /> <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label> <br /> <br /> <input id="Button1" type="button" value="ENABLE" onclick="enable();" /> <br /> <input id="Button2" type="button" value="DISABLE" onclick="disable();" /> </form> </body></html>
and this is code behind
using System;
namespace WebApplication1{ public partial class Content : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) {
}
protected void WebDataMenu1_ItemClick(object sender, Infragistics.Web.UI.NavigationControls.DataMenuItemEventArgs e) { Label1.Text = e.Item.Key; } } }
When user clicks on any item on WebDataMenu, page is submitted and in label we output the Key of the button which was clicked. When we execute javascript code which either enables or disables WebDataMenu items, when we click on one of the items which changed state, page is not submitted but it's redirected to root directory, for example url is http://localhost/infragistics/Content.aspx and after clicking item which state was changed we are redirected to http://localhost/infragistics.
Can you please explain me what is happening here. We have multiple scenarios when items are enabled/disabled on client side and on server side in regards to permissions and roles and what is selected on page.
Thanks.
hey,
Thanks for brining this up. I have tested with various assembly versions, and I agree there is a difference in behavior. But what I am experiencing is slightly different from what you have described, therefore I would like to describe what I am seeing, and if you confirm I will basically create a development issue that we'll fix.
1. I click on "Disable" to disable the two menu items
2. I click back "Enable" in order to enable them
3. Now I try to click on Edit or Remove.
What happens is that I need another click in order to have the label show the value of the menu item. The first click doesn' t update the label value (and it stays to the default value of "Label")
Thanks,
Angel
let me know what your feedback about this is. Thanks
we decided to use different scenario when dealing with WebDataMenu items
But it works just for IE...
Okay I find how to pass through
when You use enabled, the item becomes a Href. An anchorElement is create. (Href)
so, I clear attribute Href and give the class name.
check my code
// on grise les items qui doivent l'être
for (i = 0; i < z_Items.get_length(); i++) {
if (z_Items.getItem(i) != undefined) {
z_Items.getItem(i).set_enabled(true);
if (z_Items.getItem(i).get_key() == "Coller") {
z_Items.getItem(i).set_enabled(false);
// verifier si il est deja honorer
// on check la lettre H
if (z_Items.getItem(i).get_key() == "Honorer") { //permet de regarder si le rdv est deja honorer ou non si il a ete deja honorer alors on gris honorer
if (p_TypRdv == "G" || p_TypRdv == "K") {
z_Items.getItem(i).get_anchorElement().clearAttributes();
z_Items.getItem(i).get_anchorElement().className = "igdm_IGMenuItemVerticalRootLink";
I have a similar problem, since the new version (13.3), when I set side client enable to item, they transform in Href !?
I use "set_enabled()"
How to stop this comportement
Cheers
just checking if everything is going fine with your project. please let me know if you need any additional assistance. thanks