Page 3 of 3 FirstFirst 123
Results 21 to 24 of 24

Thread: Files to be included

  1. #21
    Sencha User
    Join Date
    Mar 2007
    Posts
    7,854

    Default

    If you're still having problems, please post a link or the code you have - the example posted in this thread is missing stuff, so I'd rather see what you have currently.

  2. #22

    Default

    Tim,

    I appreciate it. The code I have is just a copy of Christian's with the include paths changed to reflect my local installation and the library's directory changes between yui-ext 0.31 and 0.33. It works with 0.31 and I've copy and pasted it below:
    Code:
    <!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>
          <meta http-equiv="content-type" content="text/html; charset=utf-8" />
          <title></title>
          <link href="jscripts/lib/yui-ext.31/resources/grid.css" type="text/css" rel="stylesheet" />
          <script type="text/javascript" src="jscripts/lib/yui/build/yahoo/yahoo.js" ></script>
          <script type="text/javascript" src="jscripts/lib/yui/build/event/event.js" ></script>
          <script type="text/javascript" src="jscripts/lib/yui/build/dom/dom.js" ></script>
          <script type="text/javascript" src="jscripts/lib/yui/build/dragdrop/dragdrop.js" ></script>
          <script type="text/javascript" src="jscripts/lib/yui/build/animation/animation.js" ></script>
          <script type="text/javascript" src="jscripts/lib/yui-ext.31/yui-ext.js" ></script>
    <script type="text/javascript">
    
    
    Example = {
        init : function(){
            // some data yanked off the web
            this.myData = [
          ['14000',1,0.02,0.03,'9/1 12:00am'],
            ['14001',0,0.42,1.47,'9/1 12:00am'],
            ['14002',2,0.28,0.34,'9/1 12:00am'],
          ['14003',3,0.02,0.03,'9/1 12:00am'],
            ['14004',0,0.42,1.47,'9/1 12:00am'],
            ['14004',0,0.28,0.34,'9/1 12:00am'],
          ['14005',0,0.02,0.03,'9/1 12:00am'],
            ['14006',3,0.42,1.47,'9/1 12:00am'],
            ['14007',4,0.28,0.34,'9/1 12:00am'],
          ['14008',2,0.02,0.03,'9/1 12:00am'],
            ['14009',1,0.42,1.47,'9/1 12:00am'],
            ['14010',0,0.28,0.34,'9/1 12:00am'],
          ['14011',1,0.02,0.03,'9/1 12:00am'],
            ['14012',2,0.42,1.47,'9/1 12:00am'],
            ['14013',3,0.28,0.34,'9/1 12:00am']
          ];
            var dataModel = new YAHOO.ext.grid.DefaultDataModel(this.myData);
           
            // example of custom renderer function
            function italic(value){
                return '' + value + '';
            }
          
          // example of custom renderer function
            function change(val, suffix){
              suffix = suffix || '';
              if(val > 0){
                  return '<span style="color:green;">' + val + suffix + '</span>';
              } else if(val < 0){
                  return '<span style="color:red;">' + val + suffix + '</span>';
              }
              return val;
          }
          // example of custom renderer function
            function pctChange(val){
              return change(val, '%');
          }
          
          // example of custom renderer function, this hideous code was grabbed off the web
            function money(mnt) {
                mnt -= 0;
                mnt = (Math.round(mnt*100))/100;
                mnt = (mnt == Math.floor(mnt)) ? mnt + '.00' : ( (mnt*10 == Math.floor(mnt*10)) ? mnt + '0' : mnt);
                return "$" + mnt;
            }
           
            // sortTypes provide support for custom sorting comparison functions
          // not needed for this table but here for demonstration
            var sort = YAHOO.ext.grid.DefaultColumnModel.sortTypes;
           
            // the DefaultColumnModel expects this blob to define columns. It can be extended to provide
            // custom or reusable ColumnModels
            var myColumns = [
             {header: "Bild", width: 200, sortable: false, sortType: sort.asUCString},
             {header: "Rating", width: 100, sortable: true, renderer: money},
             {header: "Change", width: 100, sortable: true, renderer: change},
             {header: "% Change", width: 100, sortable: true, renderer: pctChange},
             {header: "Last Updated", width: 100, sortable: true, renderer: italic}
          ];
          var colModel = new YAHOO.ext.grid.DefaultColumnModel(myColumns);
          
          // create the Grid
            this.grid = new YAHOO.ext.grid.Grid('grid-example', dataModel, colModel);
            var start = new Date().getTime();
            this.grid.render();
            var end = new Date().getTime();
            //alert('Rendered in ' + ((end-start)/1000) + ' seconds');
            this.grid.getSelectionModel().selectFirstRow();
          
        }
    }
    
    YAHOO.util.Event.on(window, 'load', Example.init, Example, true);
    </script>
       </head>
       <body>
    <div id="grid-example" style="width:630px;height:250px;overflow:hidden;position:relative;"></div>   
       </body>
    </html>
    Then when I change the paths to the new directory:

    Code:
          <link href="jscripts/lib/yui-ext.0.33/resources/css/grid.css" type="text/css" rel="stylesheet" />
          <script type="text/javascript" src="jscripts/lib/yui-ext.0.33/yui-ext.js" ></script>
    <script type="text/javascript">

    I get this error in FF1.5 (XP):


    Code:
    Error: YAHOO.ext.util has no properties
    Source file: http://localhost/portfolio/jscripts/....33/yui-ext.js
    Line: 11
    and in IE6:

    Code:
    'YAHOO.ext.grid.DefaultDataModel' is null or not an object
    I am using yui 0.11.3.


    Thanks Again, K.

  3. #23
    Sencha User
    Join Date
    Mar 2007
    Posts
    7,854

    Default

    I think you still have an invalid path - one of your files is not being found. I tried this with yui-ext.33 and it works fine. It doesn't matter whether you use the individual yahoo js files or the combined utilities.js files. This is all I've included:

    Code:
          <script type="text/javascript" src="/yui/build/utilities/utilities.js" ></script>
          <script type="text/javascript" src="/yui-ext/yui-ext.js" ></script>
          <link type="text/css" rel="stylesheet" href="/yui-ext/resources/css/grid.css" />
    Also, YUI is on version .12 (maybe .12.1) - I don't believe there were any breaking changes, but you should get the latest codebase.

  4. #24

    Default

    Thanks Tim,

    It's a yui dependency.

    When I swap the yui 11.3 library for the 12.1 version--no changes to the code--it works. Also, when I changed the code to use utilities.js from yui 12.1 (it's not in 11.3) it works.

    Most likely, there were yui organizational changes between 11.3 and 12.1 that caused the break. Less likely, my old yui library was corrupted.

    Thanks For The Assist, K.

Page 3 of 3 FirstFirst 123

Similar Threads

  1. gzip JS and CSS files?
    By Slapyo in forum Ext 1.x: Help & Discussion
    Replies: 17
    Last Post: 24 Nov 2009, 7:05 PM
  2. JSDoc template files
    By jamaljohnson in forum Ext 1.x: Help & Discussion
    Replies: 20
    Last Post: 17 Jan 2008, 2:37 AM
  3. What is the files I should include??
    By G_elias in forum Sencha Cmd
    Replies: 2
    Last Post: 18 Mar 2007, 10:34 PM
  4. js not present in included page via UpdateManager.update
    By erdxoin in forum Ext 1.x: Help & Discussion
    Replies: 8
    Last Post: 15 Mar 2007, 5:19 AM
  5. What files do I need to get started using yui-ext ?
    By valc in forum Ext 1.x: Help & Discussion
    Replies: 6
    Last Post: 26 Oct 2006, 7:55 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •