Prototype compatibility

4 posts, 0 answers
  1. Luigi Gaeta
    Luigi Gaeta avatar
    16 posts
    Member since:
    Jul 2005

    Posted 09 Dec 2008 Link to this post

    Hi guys,
    I'm testing the RadColorPicker in my project and I find a compatibility trouble with prototype.js library.
    Following an example to reproduce the error. If you remove the line <script type="text/javascript" src=".... prototype.js"></script> everything goes fine.


    <%

    @ Page Language="C#" AutoEventWireup="true" CodeFile="ProvaColorPicker.aspx.cs" Inherits="Prove_ProvaColorPicker" %>

     

    <%

    @ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

     

    <!

     

    DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

     

    <

     

    html xmlns="http://www.w3.org/1999/xhtml" >

     

    <

     

    head runat="server">

     

     

     

    <title>Test ColorPicker</title>

     

     

     

    <script type="text/javascript">

     

     

     

    function colorChange(sender, eventArgs)

     

    {

     

     

    var myDiv = document.getElementById("myDiv");

     

    myDiv.innerHTML =

     

    'Color changed from ' + eventArgs.get_oldColor()

     

    +

     

    " to " + sender.get_selectedColor();

     

     

     

    return;

     

    }

     

     

    </script>

     

    </

     

    head>

     

    <

     

    body>

     

     

     

    <form id="form1" runat="server">

     

     

     

    <asp:ScriptManager ID="ScriptManager1" runat="server">

     

     

     

    </asp:ScriptManager>

     

     

     

    <script type="text/javascript" src="../Library/scriptaculous/scriptaculous-js-1.8.2/lib/prototype.js" ></script>

     

     

     

    <div>

     

     

     

    <telerik:RadColorPicker ID="RadColorPicker1" runat="server" Columns="16" Preset="web216"

     

    OnClientColorChange

     

    ="colorChange" ShowIcon="true">

     

     

     

    </telerik:RadColorPicker>

     

     

     

    <div id="myDiv"></div>

     

     

     

    </div>

     

     

     

    </form>

     

    </

     

    body>

     

    </

     

    html>

     

  2. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 09 Dec 2008 Link to this post

    Hi Luigi,

    This problem will be fixed in SP2. In short, the reason for the problem itself is that the Array object is enhanced with some properties in prototype.js. This alone changes the way the "for ... in" loop acts on an array. By default the "for...in" statement is used to loop (iterate) through the elements of an array or through the properties of an object. 
     
    You can test how the prototype.js modifies the behavior of that loop with the following code - test it with and without the script reference:
    <head runat="server">  
        <title>Untitled Page</title> 
        <script type="text/javascript" src="prototype-1.6.0.3.js"></script> 
    </head> 
    <body> 
        <form id="form1" runat="server">  
            <asp:ScriptManager ID="ScriptManager1" runat="server" /> 
              
            <button onclick="TestForInLoop(); return false;">Test for...in loop</button> 
              
            <script type="text/javascript">  
            function TestForInLoop()  
            {  
                var testArray = [];  
                testArray[0] = "first";  
                testArray[1] = "second";  
                testArray[2] = "third";  
                  
                for(var item in testArray)  
                {  
                    alert(item);  
                }  
            }  
              
            </script> 
        </form>      
    </body> 





    All the best,
    Georgi Tunev
    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. Luigi Gaeta
    Luigi Gaeta avatar
    16 posts
    Member since:
    Jul 2005

    Posted 09 Dec 2008 Link to this post

    Thanks for your reply,
    yes I've seen the issue.
    When you think to release the SP2?

     

  5. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 10 Dec 2008 Link to this post

    Hello Luigi,

    Currently there is no fixed date for it, but it should appear in the beginning of the next month.


    All the best,
    Georgi Tunev
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Back to Top