ClientEvents-RowSelected is not fired in FireFox - RadCodeBlock problem

9 posts, 0 answers
  1. Krzysztof
    Krzysztof avatar
    29 posts
    Member since:
    Aug 2008

    Posted 29 Nov 2008 Link to this post

    Hi

    I have code like :


    <head id="Head1"  runat="server">
        <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script type="text/javascript">
                <!--                
                    function RowSelected(sender, eventArgs)
                    {
                        var text = "";
                        text += "Row with index: " + eventArgs.get_itemIndexHierarchical() + " was selected";
                        document.getElementById("OutPut").innerHTML = text;
                    }                               
                -->
        </script>
        </telerik:RadCodeBlock>
    </head>
    <body class="BODY">
        <form runat="server" id="mainForm" method="post" style="width: 100%;">
            <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
            <!-- content start -->
            <div id="log" class="module" style="width: 350px; margin-bottom: 20px; font-weight: bold;
                height: 20px;" runat="server">
            </div>
            <div class="module" style="height: 20px; width: 350px;">
                <span style="font-weight: bold;">Last event: </span><span id="OutPut" style="font-weight: bold;
                    color: navy;"></span>
            </div>
            <br />
           
            <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server"  >      
            <div style="width:740px;overflow:auto">
            <telerik:RadGrid ID="RadGrid1" Skin="Sunset" runat="server"  AutoGenerateEditColumn="true"
                 PageSize="10" OnNeedDataSource="RadGrid1_NeedDataSource">
                <MasterTableView Width="100%" EditMode="PopUp" >           
                </MasterTableView>
                <ClientSettings EnableRowHoverStyle="true">
                    <ClientEvents OnRowSelected="RowSelected" ></ClientEvents>
                    <Selecting AllowRowSelect="True"></Selecting>
                   
                </ClientSettings>
            </telerik:RadGrid>
            </div>
            </telerik:RadAjaxPanel>        
            <!-- content end -->       
        </form>
    </body>

    ......... If I click on row everything in IE and FireFox works fine. Informatin about clicked row is shown. I can edit in PopUp window too.


    Now. if I made file Test.js like (with the same function) :

                 function RowSelected(sender, eventArgs)
                    {
                        var text = "";
                        text += "Row with index: " + eventArgs.get_itemIndexHierarchical() + " was selected";
                        document.getElementById("OutPut").innerHTML = text;
                    }


    and atachet it to my aspx file, this file loo like :

    <head id="Head1"  runat="server">
      <script src='Test.js' language="javascript" type="text/jscript"></script>
    </head>
    <body class="BODY">
        <form runat="server" id="mainForm" method="post" style="width: 100%;">
            <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
            <!-- content start -->
            <div id="log" class="module" style="width: 350px; margin-bottom: 20px; font-weight: bold;
                height: 20px;" runat="server">
            </div>
            <div class="module" style="height: 20px; width: 350px;">
                <span style="font-weight: bold;">Last event: </span><span id="OutPut" style="font-weight: bold;
                    color: navy;"></span>
            </div>
            <br />
           
            <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server"  >      
            <div style="width:740px;overflow:auto">
            <telerik:RadGrid ID="RadGrid1" Skin="Sunset" runat="server"  AutoGenerateEditColumn="true"
                 PageSize="10" OnNeedDataSource="RadGrid1_NeedDataSource">
                <MasterTableView Width="100%" EditMode="PopUp" >           
                </MasterTableView>
                <ClientSettings EnableRowHoverStyle="true">
                    <ClientEvents OnRowSelected="RowSelected" ></ClientEvents>
                    <Selecting AllowRowSelect="True"></Selecting>
                   
                </ClientSettings>
            </telerik:RadGrid>
            </div>
            </telerik:RadAjaxPanel>        
            <!-- content end -->       
        </form>
    </body>

     ... in IE everything work fine but in FireFox nothing work good. RowClick Event do not fire, I can't open PopUp window and edit row. Why ??

    I tried to made :

    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script src='Test.js' language="javascript" type="text/jscript"></script>
      </telerik:RadCodeBlock>

    ... but I have the same problems with this code.

    Regards
    Krzysztof


  2. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 01 Dec 2008 Link to this post

    Hi Krzysztof,

    Can you please replace RadCodeBlock with RadScriptBlock and let me know about the result?

    Kind regards,
    Vlad
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Krzysztof
    Krzysztof avatar
    29 posts
    Member since:
    Aug 2008

    Posted 01 Dec 2008 Link to this post

    Hi Vlad

    I repaced code like :
    < telerik:RadScriptBlock ID="RadS1" runat="server">   
      <script src='Test.js' language="javascript" type="text/jscript"></script>   
    </telerik:RadScriptBlock> 
     
     
    ... and I have the same problems in FireFox. In IE everything work stil fine.

    Regards
    Krzysztof
  5. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 01 Dec 2008 Link to this post

    Hi Krzysztof,

    I spoke to soon - sorry!

    The problem is due to the type of the script:
    <script src='Test.js' language="javascript" type="text/jscript"></script>  

    Please use type="text/javascript" instead!

    Best wishes,
    Vlad
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  6. Krzysztof
    Krzysztof avatar
    29 posts
    Member since:
    Aug 2008

    Posted 01 Dec 2008 Link to this post

    Hi

    This code work fine in FireFox too. Thank you.
    But I have still problems with FireFox browser. 

    if I change JavaScript function like :

    function RowSelected(sender, eventArgs)  
    {  
      //var text = "";  
      //text += "Row with index: " + eventArgs.get_itemIndexHierarchical() + " was selected";  
      //document.getElementById("OutPut").innerHTML = text;  
     
      alert(); // <<< FireFox problem !!!!!  


     ... in FireFox I can not see alert(); window. 
    In IE I can see alert window from this code. Why ???

    Regards
    Krzysztof
  7. Sebastian
    Admin
    Sebastian avatar
    9934 posts

    Posted 01 Dec 2008 Link to this post

    Hello Krzysztof,

    I think that the discussions in the following public forum posts will help you address the issue you are currently facing:

    http://www.designerstalk.com/forums/help-me/9793-javascript-innerhtml-firefox-alternative.html
    http://www.webdeveloper.com/forum/showthread.php?t=71146

    Regards,
    Sebastian
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  8. Krzysztof
    Krzysztof avatar
    29 posts
    Member since:
    Aug 2008

    Posted 01 Dec 2008 Link to this post

    Hi

    I asked about alert(), not about innerHTML.
    My code look like :

    function RowSelected(sender, eventArgs)     
    {     
      alert(); // <<< FireFox problem !!!!!     
    }    
     

    Why I can not see javaScript alert window in FireFox ??

    Regards
    Krzysztof
  9. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 01 Dec 2008 Link to this post

    Hello Krzysztof,

    I believe that FF will not display alert with empty argument.

    All the best,
    Vlad
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  10. Krzysztof
    Krzysztof avatar
    29 posts
    Member since:
    Aug 2008

    Posted 01 Dec 2008 Link to this post

    HI

    Thank You. Now is ok in FireFox.

    Regards
    Krzysztof
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017