max

Forum Replies Created

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • in reply to: TypeError: this.$firstLink is null #2326
    max
    Participant

    Oops, the post cut out part of my text.

    I said my problem was that I had an extra

    <listed item> but when I put “l” and “i” inside brackets it disappears. see end of last post.

    So the error

    
    'this.$firstLink' is null
    

    is caused by simple incorrect html syntax.

    in reply to: TypeError: this.$firstLink is null #2325
    max
    Participant

    Dear Admin: I spent hours on the debugger to fix my problem. Finally, I started searching for a better jquery-based drop down menu system.

    I COULD NOT FIND one as nice as yours. But I was going to switch.

    you were right. My problem was so simple.

    here’s the code I had wrong:

    
    <li><a>ITC/context_tile.jsf?menu=show>Slide Show</a>
       <ul>
           <li><a href="#">Manage slide show</a></li>
               <ul>
                    <li><a href="stuff">...</a></li>
              </ul>
          </li>
       </ul>
    </li>
    

    I add an extra <li>.

    I would of never guessed the problem was so simple. Ended up that IE processed the menu find. Firefox did not.

    Thank you so much. I’m glad to be back in the “SmartMenu” fold.

    in reply to: TypeError: this.$firstLink is null #2317
    max
    Participant

    I should also mention that prior to the error on line 336 I got the Explorer 8.0.6 error:

    Line: 584
    Object required jquery.smartmenus.js

    which in my version of smart menus (0.93) is as follows starting at line 574

    
    574: menuInit: function($ul) {
      75:    if (!ul.dataS('in-mega')) {
      76:       this.subMenus.push($ul);
      77:       // mark UL's in mega drop downs (if any) so we can neglect them
      78:       if ($ul.hasClass('mega-menu')) {
      79:          $ul.find('ul').dataSM('in-mega',true);
      80:       }
      81:      // get level (much faster than, for example, using parentsUtil)
      82:      var level = 2,
      83:            par = $ul[0];
    584:      while ((par = par.parentNode.parentNode) != this.$root[0]) {
      85:         level++;
      86:      }
    
    in reply to: TypeError: this.$firstLink is null #2316
    max
    Participant

    I redid this with jquery.smartmenus.js and I got the following error:

    ‘this.$firstLink’ is null or not an object

    jquery.smartmenus.js Line: 336

    Lines

    335: isCssOn: Function() {
    return this.$firstLink.css(‘display’) == ‘block’
    },

    Note, I’m going to redo this post and ask in a separate post.

    Thank You,

    Max

    in reply to: TypeError: this.$firstLink is null #2315
    max
    Participant

    I was fooling around with the “var jq = $.noConflict” stuff, which I might need to come back to in another post.

    But got the error

    
    'this.$firstLink' is null or not an object in Line 3: jquery.smartmenu.min.js
    

    Would I also use a timeout vice destroy and where would this be. I do see a “destroy” call in jquery.smartmenus.min.js

    but don’t know if this is what you referring to in this post.

    Thank You,

    Max

    max
    Participant

    Followed your instructions again. And got my stuff to work with Requirejs. So I owe a big thanks.

    Thank you so much.

    I have a public facing web site now and in future will expose code directly.

    in reply to: Smartmenus will not work when Jquery is loaded by Requirejs #1495
    max
    Participant

    I’m still don’t have yet a public facing web site.

    I do have a question concerning Requirejs syntax that may be outside the scope
    of this forum. If it is, I understand, but just in case, let me continue!
    In our business layer we have the following:

    
    web/index.html
    web/js/lib/jquery/main.js
    web/js/lib/jquery/jquery-1.7.2.js  (which I believe should work with smartmenus
    web/js/lib/jquery/jquery.smartmenus.min.js
    web/js/lib/requirePathsConfig.js  (here you add require.config.js)
    

    Note, the addition of “jquery” in the path. The requirePathsConfig.js uses slightly different format.

    Below is the format of “requirePathsConfig.js”

    
    /* js/lib/requirePathsConfig.js */
    
    var require = require || {paths:{},shim:{}};
    (function(require){
        var context = "/" + location.pathname.split("/")[1] + "/";
        var web = context + "web/js/";
        var bl = context;
    
        var config = {
           //baseUrl: web + "js/",
           paths : {
               /*
                * Paths lists the locations of particular scripts in web.
                * These will be used with the shim config option to setup dependencies for
                * each library.
                */
    
               jquery : web + "jquery/jquery-1.7.2", /
               // ** not using jquery.jqGrid-4.5.2 until fully tested with all Web features **
               jqGrid : web + "jquery/plugins/webvisGridView/jquery.jqGrid-4.4.1/jquery.jqGrid.src", 
               jqGridLocale : web + "jquery/plugins/webvisGridView/jquery.jqGrid-4.4.1/grid.locale-en",
     
               // Smartmenu stuff note, the different format
               "jquery.smartmenus" : "jquery/jquery.smartmenus.min"
    
               // maybe should put main.js ref here?  "main" : "jquery/main",
    
           },
           shim: {
    
      /* Hold the dependencies needed for each script. Designed to for 
        * RequireJS v2.0 or higher. Array holds the dependency requirements for each script    above. */
    
             // recommended from smartmenu forum	   
    		   "jquery.smartmenus": {
    		      deps: [ "jquery" ],
    			  exports: "jQuery.fn.smartmenus"
    		   },
    
       	   jqGridLocale: ["jquery", "jqUI"],
        	   jqGrid: ["jqGridLocale"]
    
           }
        };
    
        //copy config into the global require
        // Basically take what we have already, and append the paths/shim.
        var copy = function(elementName){
    	    for (var x in config[elementName]) {
    	    	if (config[elementName].hasOwnProperty(x)) {
    	    		require[elementName][x] = config[elementName][x];
    	    	}
    	    }
    	};
    	//alert(paths['jquery']);
        copy("paths");
        copy("shim");
    })(require);
    // recommended from smartmenu forum requirejs([web+"jquery/main"]);
    alert("finished requirePathsConfig.js");
    

    —————————————————————————————

    I tried different syntax changes. Incorporating your recommendations but still
    missing something basic.

    Note, also instead of using

    to load say "requireConfigPaths.js" the code I see uses"

    instead of

    --------------------------------------------------------------------------
    Can you recommend how to incorporate say "requirejs([web +"jquery/main"]) with the structure shown above?

    Thank You,

    in reply to: Smartmenus will not work when Jquery is loaded by Requirejs #1494
    max
    Participant

    Thank You, I’m testing now and will presents finding and more details.

Viewing 8 posts - 1 through 8 (of 8 total)

Register

You will be emailed a link to set your password.

Login

Lost password?