Page 4 of 4 FirstFirst ... 234
Results 31 to 34 of 34

Thread: Ref Property

  1. #31
    Sencha Premium User jvandemerwe's Avatar
    Join Date
    Apr 2009
    Location
    Raalte, Netherlands
    Posts
    260

    Default

    Quote Originally Posted by dajester2008 View Post
    The big issue here in my mind is not which is a better technology - that is an endless (and pointless) war.

    The API's keep magically changing, and breaking backwards compatibility. Ext2 -> Ext3 broke alot of stuff, and the same seems to be happening with v4. The users of this library expect their application that they spent endless hours developing to just work without having to go through lines and lines of code to replace missing API dependencies with the new syntax. They expect to gain the benefits of the new core while using the existing API calls.

    And furthermore, what we're talking about here is a measly 15 lines of code added to the AbstractComponent class for this to work again.

    PHP Code:

    // from Ext3's Component class source

        
    initRef : function(){
            if(
    this.ref && !this.refOwner){
                var 
    levels this.ref.split('/');
                var 
    last levels.length0;
                var 
    this;
                while(
    last){
                    if(
    t.ownerCt){
                        
    t.ownerCt;
                    }
                    
    i++;
                }
                
    t[levels[--i]] = this;
            }
        } 
    and

    PHP Code:
    this.initRef(); 
    in the render() method.
    Quote Originally Posted by dajester2008 View Post
    I appologize for my previous post, I didn't read this post as thoroughly as I had thought. This is good news, thank you.
    I don't agree that a compatibility layer is a solution to have "old" Ext3 programs run. It creates in the end dirty programming. Like, if I don't understand it in 4, I'll do it still in 3. This is nice for a transition period, but not for the long run. The main issue is that Sencha has to understand that their user base is becoming so large, that they simply can't act that every release change is like going from Ext 0.1 Beta to 0.2 or so. You have to respect to a certain extend also that a great user base is making also a lot of applications, that expect at least backwards compatibility. The forum is too often the source where developers find clarity about migration issues. This means that the compatibility and upgrade guidelines of Sencha are insufficiently documented.

  2. #32
    Ext JS Premium Member
    Join Date
    Apr 2010
    Posts
    51

    Default Need Ref

    So do you have an easy way to identity every ref defined and then every use of that ref and then convert to this "better" way of doing things?

    Otherwise please bring back ref. Without it we will most likely have to abandon Extjs altogether. The problem is we have a huge investment in this and to go through 100k+ lines trying to figure out where we used a reference and replace it with another way of doing the same thing is never going to happen.

    If you have a tool that can identify where we declared refs and then replace them, great. Otherwise it seem like Sencha really doesn't understand how to support enterprise projects and even if it gets better we can't convince management to trust it.

    That's really unfortunate as we love it. It just feels like maybe you are too far behind the wall and don't see what impact these changes are having. Just saying the "new way is better" doesn't rewrite 100k lines of code.


  3. #33
    Sencha Premium Member StaticVoidMain's Avatar
    Join Date
    Aug 2007
    Location
    Buenos Aires - Argentina
    Posts
    38

    Lightbulb

    Quote Originally Posted by blex2010 View Post
    So do you have an easy way to identity every ref defined and then every use of that ref and then convert to this "better" way of doing things?

    Otherwise please bring back ref. Without it we will most likely have to abandon Extjs altogether. The problem is we have a huge investment in this and to go through 100k+ lines trying to figure out where we used a reference and replace it with another way of doing the same thing is never going to happen.

    If you have a tool that can identify where we declared refs and then replace them, great. Otherwise it seem like Sencha really doesn't understand how to support enterprise projects and even if it gets better we can't convince management to trust it.

    That's really unfortunate as we love it. It just feels like maybe you are too far behind the wall and don't see what impact these changes are having. Just saying the "new way is better" doesn't rewrite 100k lines of code.

    I totally agree with you, here is my override to solve this:

    PHP Code:
    Ext.override(Ext.Component, {
        
    initComponent: function () {
            
    this.callParent();
            
    this.on('render'this.setupRefs);
        },
        
    setupRefs: function () {
            if (
    this.ref && !this.refOwner) {
                var 
    levels this.ref.split('/');
                var 
    last levels.length0;
                var 
    this;
                while (
    last) {
                    if (
    t.ownerCt) {
                        
    t.ownerCt;
                    }
                    
    i++;
                }
                
    t[levels[--i]] = this;
                
    this.refOwner t[levels[--i]];
        }
    }); 

  4. #34
    Ext JS Premium Member sumit.madan's Avatar
    Join Date
    May 2009
    Location
    Bangalore, India
    Posts
    126

    Default

    @StaticVoidMain:

    Your override did not work, I modified it to:

    Code:
    Ext.override(Ext.Component, {
        afterRender: function () {
            this.callOverridden();
            this.setupRefs();
        },
        
        setupRefs: function () {
            if (this.ref && !this.refOwner) {
                var levels = this.ref.split('/');
                var t = this;
                for(var i = 0; i < levels.length - 1; i++) {
                    if (t.ownerCt) {
                        t = t.ownerCt;
                    }
                }
                t[levels[levels.length - 1]] = this;
                this.refOwner = t;
            }
        }
    });

Page 4 of 4 FirstFirst ... 234

Similar Threads

  1. Property grid
    By Np11 in forum Ext GWT: Discussion
    Replies: 1
    Last Post: 29 Sep 2010, 1:52 AM
  2. get value/property
    By Generic1 in forum Ext 3.x: Help & Discussion
    Replies: 2
    Last Post: 27 Jul 2009, 6:47 AM
  3. Set CSS property
    By stvlinux in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 14 Oct 2008, 8:12 AM
  4. property, id, root, total property config help
    By Jigesh Shah in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 22 Apr 2008, 2:50 PM

Posting Permissions

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