1. #1
    Ext User
    Join Date
    Mar 2007
    Posts
    19
    Vote Rating
    0
    dflkid is on a distinguished road

      0  

    Default insertAdjacentHTML error

    insertAdjacentHTML error


    I'm trying to set up a page using your remote dataset with the datagrid example, but I keep getting a javascript error stating "InsertAdjacentHTML is null or not an object". I'm using your latest release and including the following:

    build/yahoo/yahoo.js
    build/dom/dom.js
    build/event/event.js
    build/dragdrop/dragdrop.js
    build/animation/animation.js
    build/connection/connection.js
    build/container/container.js
    yui-ext.32/yui-ext.js

    Any thoughts?

  2. #2
    Sencha User genius551v's Avatar
    Join Date
    Mar 2007
    Posts
    287
    Vote Rating
    0
    genius551v is on a distinguished road

      0  

    Default maybe this should be help you...

    maybe this should be help you...


    seria necesario ver mas codigo para poder decirte algo hacerca de lo que te falta, a mi primera impresion te faltaria your-editor-gird.js que es el que construye la grilla a partirde un div en la pag html, pero como te digo seria necesario ver el resto del codigo o si es posible postear un ejemplo.

    Por el momento puedo referenciar un ejemplo que construi con ExampleEditor.js de jack.

    http://www.cadenatextilconfeccion.co...rid_editor.htm

    ...a consideracion del respetable jack...

  3. #3
    Sencha User jack.slocum's Avatar
    Join Date
    Mar 2007
    Location
    Tampa, FL
    Posts
    6,955
    Vote Rating
    17
    jack.slocum will become famous soon enough jack.slocum will become famous soon enough

      0  

    Default


    Like he said, can you post some code or better yet put up a page? It's impossible to just guess.

  4. #4
    Ext User
    Join Date
    Mar 2007
    Posts
    19
    Vote Rating
    0
    dflkid is on a distinguished road

      0  

    Default


    Here's what I'm running. It's an example I found in the forums. Unfortunately I can't post to a public location.

    Code:
    <DOCTYPE>
    
    <html>
    <head>
    	<title>Untitled</title>
    	
          <link>
    	  
          <script></script>
          <script></script>
          <script></script>
          <script></script>
          <script></script>
          <script></script>
    	<script></script>
          <script></script>
    
    	  
    
    <script>
          var urlColList = [
             {header: "Feeds", width: 180, sortable: true},
             {header:"Link", width: 20, sortable: false} // this would be hidden
          ];
          var urlCM  = new YAHOO.ext.grid.DefaultColumnModel(urlColList);
         
          var urlSchema = {
              tagName: 'site',
              id: 'use-index',
              fields: ['feed','link']
          };
          urlDM = new YAHOO.ext.grid.XMLDataModel(urlSchema);
          urlDM.setDefaultSort(urlCM, 1, 'ASC');
         
          urlSM = new YAHOO.ext.grid.SingleSelectionModel();
          urlSM.onRowSelect.subscribe(this.loadFeedUrl, this, true);
          urlGrid = new YAHOO.ext.grid.Grid('feed-list', this.urlDM, urlCM, this.urlSM);
          urlGrid.render();
         
          urlDM.load('test.xml');
    
    </script>
    
    
    </head>
    
    <body>
    
    <div></div> 
    
    
    </body>
    </html>
    The div contains: id="feed-list" class=ygrid-mso style="width:630px;height:250px;overflow:hidden;position:relative;"

  5. #5
    Sencha User jack.slocum's Avatar
    Join Date
    Mar 2007
    Location
    Tampa, FL
    Posts
    6,955
    Vote Rating
    17
    jack.slocum will become famous soon enough jack.slocum will become famous soon enough

      0  

    Default


    You are loading and creating the grid inline (before the DOM exists). You will need to attach to onDocumentReady (preferred) or window 'load' to create the grid after the document and your grid's container element exist.

    All of the examples do this so it shouldn't be too hard to figure out. Let me know if you need any help.

    Jack

  6. #6
    Ext User
    Join Date
    Mar 2007
    Posts
    19
    Vote Rating
    0
    dflkid is on a distinguished road

      0  

    Default That was it!

    That was it!


    That was it, and it was so easy. I couldn't find the onDocumentReady in the docs, so I used the window load event. :? Thanks for the help and keep up the amazing work. My updated code is below...

    Code:
    	var DataGrid = {
        	init : function(){
    		
    		      var urlColList = [
    		         {header: "Feeds", width: 180, sortable: true},
    		         {header:"Link", width: 20, sortable: false} // this would be hidden
    		      ];
    		      var urlCM  = new YAHOO.ext.grid.DefaultColumnModel(urlColList);
    		     
    		      var urlSchema = {
    		          tagName: 'site',
    		          id: 'use-index',
    		          fields: ['feed','link']
    		      };
    		      urlDM = new YAHOO.ext.grid.XMLDataModel(urlSchema);
    		      urlDM.setDefaultSort(urlCM, 1, 'ASC');
    		     
    		      urlSM = new YAHOO.ext.grid.SingleSelectionModel();
    		      urlGrid = new YAHOO.ext.grid.Grid('feed-list', urlDM, urlCM);
    		      urlGrid.render();
    		     
    		      urlDM.load('test.xml');
    		}
    	}
    	YAHOO.util.Event.on(window, 'load', DataGrid.init, DataGrid, true);

  7. #7
    Sencha User jack.slocum's Avatar
    Join Date
    Mar 2007
    Location
    Tampa, FL
    Posts
    6,955
    Vote Rating
    17
    jack.slocum will become famous soon enough jack.slocum will become famous soon enough

      0  

    Default


    It appears JSDoc didn't pick up onDocumentReady. I hate JSDoc!

    Here's the docs and sig:

    Code:
    /**
         * Fires when the document is ready (before onload and before images are loaded)
         * @param {Function} fn The method the event invokes
         * @param {Object}   scope An arbitrary object that will be 
         *                             passed as a parameter to the handler
         * @param {boolean}  override If true, the obj passed in becomes
         *                             the execution scope of the listener
         */
        this.onDocumentReady = function(fn, scope, override){...}
    Here's the edit:
    Code:
    // YAHOO.util.Event.on(window, 'load', DataGrid.init, DataGrid, true);
    YAHOO.ext.EventManager.onDocumentReady(DataGrid.init, DataGrid, true);
    It fires when the dom is ready and doesn't wait for images and resources so it is better for initialization code.

Similar Threads

  1. gridview error: re is not defined
    By hicker in forum Ext 2.x: Help & Discussion
    Replies: 3
    Last Post: 17 Mar 2007, 12:25 AM
  2. Error in DomQuery
    By Animal in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 16 Mar 2007, 3:25 AM
  3. Error in TreeNode.js
    By galdaka in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 27 Feb 2007, 8:16 AM
  4. Popup with error
    By Chroder in forum Ext 1.x: Help & Discussion
    Replies: 1
    Last Post: 4 Nov 2006, 9:04 PM
  5. this.selModel Error
    By djfep in forum Ext 1.x: Help & Discussion
    Replies: 5
    Last Post: 6 Sep 2006, 9:19 AM

Thread Participants: 2