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

ClientEvents-RowSelected is not fired in FireFox - RadCodeBlock problem

8 Answers 177 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Krzysztof
Top achievements
Rank 1
Krzysztof asked on 29 Nov 2008, 05:58 PM
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


8 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 01 Dec 2008, 07:16 AM
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.
0
Krzysztof
Top achievements
Rank 1
answered on 01 Dec 2008, 07:36 AM
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
0
Vlad
Telerik team
answered on 01 Dec 2008, 07:55 AM
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.
0
Krzysztof
Top achievements
Rank 1
answered on 01 Dec 2008, 08:10 AM
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
0
Sebastian
Telerik team
answered on 01 Dec 2008, 08:23 AM
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.
0
Krzysztof
Top achievements
Rank 1
answered on 01 Dec 2008, 08:33 AM
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
0
Vlad
Telerik team
answered on 01 Dec 2008, 04:01 PM
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.
0
Krzysztof
Top achievements
Rank 1
answered on 01 Dec 2008, 04:08 PM
HI

Thank You. Now is ok in FireFox.

Regards
Krzysztof
Tags
Grid
Asked by
Krzysztof
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Krzysztof
Top achievements
Rank 1
Sebastian
Telerik team
Share this question
or