1. #1
    Sencha User juhyx's Avatar
    Join Date
    Jul 2007
    Location
    Czech republic
    Posts
    23
    Vote Rating
    0
    juhyx is on a distinguished road

      0  

    Default [CLOSED][2.2] TreeEditor causes JS error in IE8 after start of edit

    [CLOSED][2.2] TreeEditor causes JS error in IE8 after start of edit


    Title:
    TreeEditor causes JS error in IE8 after start of edit

    Steps to reproduce:
    1. Open testcase
    2. Double click on ExtJs node

    Problem description:
    IE7: Nothing will happen. No action, no error message.
    IE8 beta 2: Javascript error message "Type mismatch" will appear.

    There is problem in code in Ext.tree.TreeEditor:
    Code:
    	node.ui.getEl().scrollIntoView(this.tree.body);

    Method scrollIntoView is defined in ExtJs as method of Element object and also in Internet Explorer as DOM element method.
    This code causes call of DOM element method, and pass to this method parameter this.tree.body, but IE method expects boolean.
    I suppose that some type control is added into IE8 - it throws JavaScript error in IE, but this code propably dont' work in any browser.

    Solution is simple:
    Code:
    	Ext.fly(node.ui.getEl()).scrollIntoView(this.tree.body);

    Testcase:
    Code:
    Ext.onReady(function(){
    
        var tree = new Ext.tree.TreePanel({
            autoScroll:true,
    		renderTo: Ext.getBody(),
            containerScroll: true,
    		
    		loader: new Ext.tree.TreeLoader(),
            root: new  Ext.tree.AsyncTreeNode({
                text: 'My Favorite Frameworks',
                draggable:false,
                id:'source',
    			children: [ 
    				{"text" : "ExtJs", "id" : 100, "leaf" : true}
    			]
            })
        });
    
        tree.getRootNode().expand();
    	
    	var treeEditor = new Ext.tree.TreeEditor(tree, {
    		cancelOnEsc: true,
    		completeOnEnter: true
    	});
    });
    Ext version: Ext 2.2.0
    Adapter: ext-base.js
    System: Windows XP
    Browser: IE7, IE8

    Workaround (patch):
    Code:
     
    Ext.override(Ext.tree.TreeEditor, {
    	triggerEdit: function(node, defer){
    		this.completeEdit();
    		if (node.attributes.editable !== false) {
    			this.editNode = node;
    			debugger;
    			if (this.tree.autoScroll) {
    				Ext.fly(node.ui.getEl()).scrollIntoView(this.tree.body);
    			}
    			this.autoEditTimer = this.startEdit.defer(this.editDelay, this, [node.ui.textNode, node.text]);
    			return false;
    		}
    	}
    });

  2. #2
    Sencha User
    Join Date
    May 2007
    Posts
    32
    Vote Rating
    0
    Diddy433 is on a distinguished road

      0  

    Default 3.0?

    3.0?


    Is this fixed in 3.0? Just wondering. Thanks for the workaround!

  3. #3
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,251
    Vote Rating
    73
    Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold

      0  

    Default


    This has been fixed in both Ext 2.3 and Ext 3.0.0.

Thread Participants: 2

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar