Results 1 to 2 of 2

Thread: [2.0??] menu item id

  1. #1
    Ext User
    Join Date
    Mar 2007
    Posts
    34
    Vote Rating
    0
      0  

    Default [2.0??] menu item id

    We are using selenium to build and run test cases and it appears that the menu items are not including id's that are included in the config. To fix this here is an override:
    HTML Code:
    Ext.override(Ext.menu.Item, {
    	onRender: function (container, position) {
    	    var el = document.createElement("a");
    	    el.hideFocus = true;
    	    el.unselectable = "on";
    	    el.href = this.href || "#";
    		if(this.id){
    			el.id = this.id;
    		}
    	    if (this.hrefTarget) {
    	        el.target = this.hrefTarget;
    	    }
    	    el.className = this.itemCls + (this.menu ? " x-menu-item-arrow" : "") + (this.cls ? " " + this.cls : "");
    	    el.innerHTML = String.format("<img src=\"{0}\" class=\"x-menu-item-icon {2}\" />{1}", this.icon || Ext.BLANK_IMAGE_URL, this.itemText || this.text, this.iconCls || "");
    	    this.el = el;
    	    Ext.menu.Item.superclass.onRender.call(this, container, position);
    	}
    });

  2. #2
    Ext User
    Join Date
    Jun 2007
    Posts
    34
    Vote Rating
    0
      0  

    Default

    Confirmed to still exist in ExtJS 2.2.

    Like the original poster we need the ID's for Selenium to be able to find the elements. For now we patched our local version using the given example (which still seems to work fine in ExtJS 2.2).

Posting Permissions

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