This is a migrated thread and some comments may be shown as answers.

Javascript on a item

6 Answers 51 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Thierry Treunet
Top achievements
Rank 1
Thierry Treunet asked on 01 Aug 2008, 01:10 PM
Hello,

 I want to open a new page when I click in a items in a panelbar.

I Use Javascipt to open the new windows but I make :

NavigateUrl = "javascript:OuvrirDossier('C-AERIEN')"

for the item and the page don't open.

Do you have solutions?

Thank you

6 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 01 Aug 2008, 01:56 PM
Hi Thierry Treunet,

This should have worked. I tested the following:

<telerik:RadPanelItem Text="Test" NavigateUrl="javascript:alert('Test')"></telerik:RadPanelItem>
and the text "Test" was shown in a message box. Does your javascript routine work with a regular hyperlink? Consider the following:

<a href="javascript:OuvrirDossier('C-AERIEN')" >click</a>

Does this correctly open a new window?

Regards,
Albert
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Thierry Treunet
Top achievements
Rank 1
answered on 01 Aug 2008, 02:21 PM
Yes, If I make a hyperlink in my page a windows is opened.

And if I make an alert in my panelbar item there don't show a messagebox.
0
Paul
Telerik team
answered on 01 Aug 2008, 02:34 PM
Hello Thierry,

Unfortunately, the provided information does not help us much in reproducing the error. I'm afraid we could not be of much help unless we reproduce the issue on our side. It will be best if you can open a support ticket and send us a simple running project (incl. your custom skin, CSS, images, DB backup if needed and so on) demonstrating the problem (and step-by-step instructions on doing so). In that way we can reproduce and pinpoint the problems you're facing on our side, understand the logic of your application and provide a solution.

Regards,
Paul
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Thierry Treunet
Top achievements
Rank 1
answered on 01 Aug 2008, 02:46 PM
This is the code for the panelbar :

<telerik:RadPanelBar ID="RadPanelBar1" runat="server" Skin="Office2007" Font-Bold="True">
            <Items>
                <telerik:RadPanelItem runat="server" Text="Saisir une exp&#233;dition" Value="Saisir une exp&#233;dition">
                    <Items>
                        <telerik:RadPanelItem runat="server" Text="Aerien" Value="D-AERIEN">
                        </telerik:RadPanelItem>
                        <telerik:RadPanelItem runat="server" Text="Maritime" Value="D-MARITIME" >
                        </telerik:RadPanelItem>
                        <telerik:RadPanelItem runat="server" Text="Route Internationale" Value="D-INTER" >
                        </telerik:RadPanelItem>
                        <telerik:RadPanelItem runat="server" Text="Route Nationale" Value="D-ROUTE" >
                        </telerik:RadPanelItem>
                    </Items>
                </telerik:RadPanelItem>
                <telerik:RadPanelItem runat="server" Text="Suivre les exp&#233;ditions" NavigateUrl="~/Liste_Dossier.aspx?Export=0">
                </telerik:RadPanelItem>
                <telerik:RadPanelItem runat="server" Text="Rechercher une exp&#233;dition" Value="Dept" NavigateUrl="~/Recherche_Expedition.aspx">
                </telerik:RadPanelItem>
                <telerik:RadPanelItem runat="server" Text="Pointer ma pr&#233;facturation" NavigateUrl="~/Pointage_Facture.aspx">
                </telerik:RadPanelItem>
                <telerik:RadPanelItem runat="server" Text="Gestion des SAV" Value="SAV" NavigateUrl="~/Gestion_SAV.aspx">
                </telerik:RadPanelItem>
                <telerik:RadPanelItem runat="server" Text="Bon de livraison Emarg&#233;" Value="BL_Emarge" NavigateUrl="~/Liste_BL_Numerise.aspx">
                </telerik:RadPanelItem>
                <telerik:RadPanelItem runat="server" Text="Imprimer un document transport">
                    <Items>
                        <telerik:RadPanelItem runat="server" Text="Bon de livraison du jour" Value="BL_Jour">
                        </telerik:RadPanelItem>
                        <telerik:RadPanelItem runat="server" Text="Liste de chargement" Value="Liste_Chargement">
                        </telerik:RadPanelItem>
                    </Items>
                </telerik:RadPanelItem>
                <telerik:RadPanelItem runat="server" Text="Imprimer un document comptable">
                    <Items>
                        <telerik:RadPanelItem runat="server" Text="Facture" Value="Facture" NavigateUrl="~/Liste_facture.aspx">
                        </telerik:RadPanelItem>
                        <telerik:RadPanelItem runat="server" Text="Lettre traite" Value="Traite">
                        </telerik:RadPanelItem>
                        <telerik:RadPanelItem runat="server" Text="Proforma" Value="Proforma">
                        </telerik:RadPanelItem>
                    </Items>
                </telerik:RadPanelItem>
                <telerik:RadPanelItem runat="server" Text="Voir mes statistiques">
                    <Items>
                        <telerik:RadPanelItem runat="server" Text="Activit&#233;" Value="Activite">
                        </telerik:RadPanelItem>
                        <telerik:RadPanelItem runat="server" Text="Statistiques par d&#233;partement" Value="Dept">
                        </telerik:RadPanelItem>
                        <telerik:RadPanelItem runat="server" Text="Statistiques par destinataire" Value="Des">
                        </telerik:RadPanelItem>
                    </Items>
                </telerik:RadPanelItem>
                <telerik:RadPanelItem runat="server" Text="Saisir une demande de cotation">
                    <Items>
                        <telerik:RadPanelItem runat="server" Text="A&#233;rien" Value="C-AERIEN"  NavigateUrl = "javascript:OuvrirDossier('C-AERIEN')">
                        </telerik:RadPanelItem>
                        <telerik:RadPanelItem runat="server" Text="Maritime" Value="C-MARITIME" NavigateUrl = "javascript:OuvrirDossier('C-MARITIME')">
                        </telerik:RadPanelItem>
                        <telerik:RadPanelItem runat="server" Text="Route Internationale" Value="C-INTER" NavigateUrl = "javascript:OuvrirDossier('C-INTER')">
                        </telerik:RadPanelItem>
                        <telerik:RadPanelItem runat="server" Text="Route Nationale" Value="C-ROUTE" NavigateUrl = "javascript:OuvrirDossier('C-ROUTE')">
                        </telerik:RadPanelItem>
                    </Items>
                </telerik:RadPanelItem>
                <telerik:RadPanelItem runat="server" Text="News" NavigateUrl="~/News.aspx">
                </telerik:RadPanelItem>
                <telerik:RadPanelItem runat="server" Text="Contact" NavigateUrl="~/Contacts.aspx">
                </telerik:RadPanelItem>
                <telerik:RadPanelItem runat="server" Text="D&#233;connexion" NavigateUrl="~/Deconnexion.aspx">
                </telerik:RadPanelItem>
            </Items>
            <CollapseAnimation Duration="100" Type="None" />
            <ExpandAnimation Duration="100" Type="None" />
        </telerik:RadPanelBar>

this is my javascript code :


<script type="text/javascript">
        function OuvrirDossier(Nature)
        {
                 window.open('Creation_Dossier.aspx?id='+ Nature +'', 'dossier', 'resizable=yes,top=1, left=1, directories=yes, location=yes, toolbar=yes,status=yes, scrollbars=yes, menubar=yes, width='+screen.Width+',height='+screen.Height);     
        }
            
    </script>

0
Paul
Telerik team
answered on 01 Aug 2008, 03:03 PM
Hi Thierry,

We tried to reproduce the reported issue on our side using your code snippet, but to no avail. Please find attached a demo movie that show the proper work of the control. Let us know if we are missing something.

All the best,
Paul
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Thierry Treunet
Top achievements
Rank 1
answered on 10 Nov 2008, 04:43 PM
Hello,

I view your demo and my code is the same.

Do you view a reason I can't reproduce this in my computer?

Thank you
Tags
PanelBar
Asked by
Thierry Treunet
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Thierry Treunet
Top achievements
Rank 1
Paul
Telerik team
Share this question
or