PDA

View Full Version : [CLOSED] ViewPort Internet Explorer bug



boris
Feb 28, 2012, 10:29 AM
Hi, I use Razor and ext.net v2. In this example I create menu and add it on ViewPort. On Firefox and Chrome evrerything works fine. But in IE9 I have this error:

Microsoft JScript runtime error: DOM Exception: HIERARCHY_REQUEST_ERR (3)

Here is the code:


@{
//1. nivo
Button btnHome = new Button { ID="btnHome", Text="POČETNA"};
Button btnDokument = new Button { ID = "btnDokument", Text = "DOKUMENT" };
Button btnZahtev = new Button { ID = "btnZahtev", Text = "ZAHTEV" };
Button btnOdobrenje = new Button { ID = "btnOdobrenje", Text = "ODOBRENJE" };
Button btnPlacanje = new Button { ID = "btnPlacanje", Text = "PLAĆANJE" };
Button btnIzvestaji = new Button { ID = "btnIzvestaji", Text = "IZVE?TAJI" };
Button btnAdmin = new Button { ID = "btnAdmin", Text = "ADMINISTRACIJA" };
Button btnMojNalog = new Button { ID = "btnMojNalog", Text = "MOJ NALOG" };

//2. nivo
MenuItem mniDokumentUnos = new MenuItem { ID = "mniDokumentUnos", Text = "Unos dokumenta", Icon = Icon.Add };
MenuItem mniDokumentIzmena = new MenuItem { ID = "mniDokumentIzmena", Text = "Izmena dokumenta", Icon = Icon.ApplicationEdit };
MenuItem mniDokumentBrisanje = new MenuItem { ID = "mniDokumentBrisanje", Text = "Brisanje dokumenta", Icon = Icon.Delete };

Menu menuDokument = new Menu { ID = "menuDokument" };
menuDokument.Add(mniDokumentUnos);
menuDokument.Add(mniDokumentIzmena);
menuDokument.Add(mniDokumentBrisanje);
btnDokument.Menu.Add(menuDokument);


Toolbar tbrMenu = new Toolbar { ID = "tbrMenu" };
tbrMenu.Items.Add(btnHome);
tbrMenu.Items.Add(btnDokument);
tbrMenu.Items.Add(btnZahtev);
tbrMenu.Items.Add(btnOdobrenje);
tbrMenu.Items.Add(btnPlacanje);
tbrMenu.Items.Add(btnIzvestaji);
tbrMenu.Items.Add(btnAdmin);
tbrMenu.Items.Add(btnMojNalog);

Viewport vpMenu = new Viewport { ID="vpMenu" };
vpMenu.Items.Add(tbrMenu);

}

@Html.X().Container().ID("ContainerMenu").Add(vpMenu)


Problem don't exists when remove ViewPort and add toolbar to container:


@Html.X().Container().ID("ContainerMenu").Add(tbrMenu)

Is this a bug and how to fix it?

Vladimir
Feb 28, 2012, 10:46 AM
Hi,

ViewPort cannot be added to any container. It is always top-level widget (SINGLE top-level widget)

Please replace


@Html.X().Container().ID("ContainerMenu").Add(vpMenu)


by


@vpMenu.ToBuilder()

boris
Feb 28, 2012, 12:01 PM
Yes, that is solution! Thanks! :)