1. #1
    Ext User
    Join Date
    Apr 2007
    Posts
    379
    Vote Rating
    0
    sfwalter is on a distinguished road

      0  

    Default Prototype and Highlight

    Prototype and Highlight


    I orginally posted this in the beta discussion group, but this is probably a better place.

    I am integrating with the prototype/scriptacilious for my Rails app. When I attempt to use highlight() I get: Effect.Morph is not a constructor within the ext-prototype-adpapter.js file.

    Any ideas? I double checked and I'm including the files in the proper order. Here is a snippet from my html file:

    <script src="/javascripts/prototype.js?1175546771" type="text/javascript"></script>
    <script src="/javascripts/effects.js?1175546771" type="text/javascript"></script>
    <script src="/javascripts/dragdrop.js?1175546771" type="text/javascript"></script>
    <script src="/javascripts/controls.js?1175546771" type="text/javascript"></script>
    <script src="/javascripts/application.js?1175546771" type="text/javascript"></script>


    <script src="/javascripts/ext-prototype-adapter.js?1175483160" type="text/javascript"></script>
    <script src="/javascripts/ext-all.js?1175483244" type="text/javascript"></script>

  2. #2
    Ext User
    Join Date
    Apr 2007
    Location
    Alexandria, VA
    Posts
    12
    Vote Rating
    0
    suntoast is on a distinguished road

      0  

    Default


    You need to use Prototype 1.5 or later.

  3. #3
    Ext User
    Join Date
    Apr 2007
    Posts
    379
    Vote Rating
    0
    sfwalter is on a distinguished road

      0  

    Default


    I believe I am. The prototype.js file says the version is "1.5.0_rc0"

    scott.

  4. #4
    Ext User
    Join Date
    Apr 2007
    Location
    Alexandria, VA
    Posts
    12
    Vote Rating
    0
    suntoast is on a distinguished road

      0  

  5. #5
    Ext User
    Join Date
    Apr 2007
    Posts
    379
    Vote Rating
    0
    sfwalter is on a distinguished road

      0  

    Default


    Ok that worked, but I found a larger problem. Before I was using YUI with a json reader and it would populate my grid just fine. However with prototype my grid would not populate. I simply changed my reader to the xmlreader and data worked with prototype how weird.

    With prototype and the jsonreader i still received the data back. I tested this by using a ds.on("load") event.

    Any thoughts?

  6. #6
    Ext User
    Join Date
    Apr 2007
    Posts
    379
    Vote Rating
    0
    sfwalter is on a distinguished road

      0  

    Default


    On further review when using the jsonreader with prototype. Although the correct number of rows are returned there is no data. I have this simple event handler:

    ds.on('load', function(){
    for (i=0;i<ds.data.items.length;i++) {
    alert(ds.data.items[i].data.name);
    }
    });

    With using prototype and json nothing appears in the alert, but simply changing to xmlreader i get the actual data to appear in the alert. Using YUI and json works just fine.

    It probably doesn't matter but here is the two different readers:

    proxy: new Ext.data.HttpProxy({url: '/dashboard/xml',method:'get'}),
    reader: new Ext.data.XmlReader({
    // records will have an "Item" tag
    record: 'preference',
    id: 'id'
    }, [
    // set up the fields mapping into the xml doc
    // The first needs mapping, the others are very basic
    {name:'name', mapping:'name'},
    {name:'id', mapping:'id'},
    {name:'value', mapping:'value'}
    ])

    and

    proxy: new Ext.data.HttpProxy({url: '/dashboard/json',method:'get'}),
    reader: new Ext.data.JsonReader({id:"id"},[
    {name:'name', mapping:'attributes.name'},
    {name:'id', mapping:'attributes.id'},
    {name:'value', mapping:'attributes.value'}])

    scott.

  7. #7
    Ext User
    Join Date
    Apr 2007
    Posts
    379
    Vote Rating
    0
    sfwalter is on a distinguished road

      0  

    Default


    Argggggggggg. Never mind, I was putting some debug code in the ext-all-debug.js file and I screwed up. Please disregard!

    sorry

    scott

  8. #8
    Ext User
    Join Date
    Apr 2007
    Posts
    11
    Vote Rating
    0
    rounder is on a distinguished road

      0  

    Default


    I'm having problem with the highlight effect and prototype. I'm trying to do the introduction tutorial. When I do Ext.get('myDiv').highlight() nothing happens. Here is my script tags in the head.

    <script type="text/javascript" src="../adapter/prototype/ext-prototype-adapter.js"></script>
    <script type="text/javascript" src="../adapter/prototype/prototype.js"></script>
    <script type="text/javascript" src="../adapter/prototype/effects.js"></script>
    <script type="text/javascript" src="../adapter/prototype/dragdrop.js"></script>
    <script type="text/javascript" src="../adapter/prototype/controls.js"></script>
    <script type="text/javascript" src="../ext-all-debug.js"></script>

    When I'm including YUI it works perfectly, but with prototype I'm getting only this warning several times (whenever highlight is executed) in the JavaScript Console (Firefox):

    Warning: Error in parsing value for property 'size'. Declaration dropped.
    Source File: file:///F:/dev/ext-1.0/IntroToExt/ExtStart.html
    Line: 0


    In IE6 I'm also getting some error for object required...

    Thanks.

  9. #9
    Ext User
    Join Date
    Apr 2007
    Posts
    379
    Vote Rating
    0
    sfwalter is on a distinguished road

      0  

    Default


    First of all make sure you are using prototype 1.5 and scriptacilious 1.7. Also I think your script tags are in the wrong order. The order should be prototype, scriptacilious, adapter, ext. Try this:

    Code:
    <script type="text/javascript" src="../adapter/prototype/prototype.js"></script>
    <script type="text/javascript" src="../adapter/prototype/effects.js"></script>
    <script type="text/javascript" src="../adapter/prototype/dragdrop.js"></script>
    <script type="text/javascript" src="../adapter/prototype/controls.js"></script>
    <script type="text/javascript" src="../adapter/prototype/ext-prototype-adapter.js"></script>
    <script type="text/javascript" src="../ext-all-debug.js"></script>

  10. #10
    Ext User
    Join Date
    Apr 2007
    Posts
    11
    Vote Rating
    0
    rounder is on a distinguished road

      0  

    Default


    I'm pretty sure that I'm with the latest version - triple checked

    Also saw that the script tags are not ordered properly - didn't help. Even copy/paste your suggestion (same as mine) ->

    Everything else is working fine. Message boxes, Grids...

    If I switch to YUI -> everything is ok.

    Also tried other effects. Puff for example has strange effect under IE6. YUI was consistent under both IE and FF.