Results 1 to 6 of 6

Thread: Selector not selection and attachlisteners

  1. #1
    Sencha User
    Join Date
    May 2013
    Location
    Marceline, Mo
    Posts
    2

    Default Answered: Selector not selection and attachlisteners

    I'm trying to grab a id from my controller the id is in the viewport and attaching a listener to it when the controller grabs the id and run after its render.
    The problem is that its not grabbing the id from the viewport and attaching the listener.


    here is my example code:https://gist.github.com/anonymous/6244605

  2. Tobiu,

    We have fixed this now. The issue was in the Layout of our HTML page (being rendered via Zend Framework). Within this layout we had set the app.js for this Ext App to run but had failed to remove the app.js from another application (also available on this server). Since the secondary app.js was causing the controllers for the other application to load it was interfering in same way with registering the event listeners.

    I also extracted the tabpanel and child htmleditor element into its own component to clean up the viewport and get away from using the ID in the Ext Controller.

    Our resulting (and functioning) code now looks like this:

    https://gist.github.com/anonymous/3ff34b82522eb038c3f6

  3. #2
    Sencha User tobiu's Avatar
    Join Date
    May 2007
    Location
    Munich (Germany)
    Posts
    2,751
    Answers
    130

    Default

    Code:
    		this.control({
    			'editorPanel':{
    				afterrender:this.onEditorRender
    			}
    		});
    checks for the xtype editorpanel which does not exist.

    '#editorPanel' checks for id / itemId.

    I strongly recommend to not use id configs at all, since they get applied on DOM level.
    Best regards
    Tobias Uhlig

  4. #3
    Sencha User
    Join Date
    May 2013
    Location
    Marceline, Mo
    Posts
    2

    Default

    I have tried to grab both the by the xtype and itemId and using the # within the itemID both way was a no go.

  5. #4
    Sencha User tobiu's Avatar
    Join Date
    May 2007
    Location
    Munich (Germany)
    Posts
    2,751
    Answers
    130

    Default

    using the # within the itemID
    not inside the itemId itself, just inside the query.

    like:
    Code:
    		this.control({
    			'#editorPanel':{
    				afterrender:this.onEditorRender
    			}
    		});
    you can not search for an xtype which you and the framework have not defined.
    Best regards
    Tobias Uhlig

  6. #5
    Sencha User
    Join Date
    Feb 2012
    Posts
    25
    Answers
    2

    Default

    Tobiu,

    I work with bearnight and we've tried using the # within the this.control in an attempt to get the event to work and have not yet been able too.

    We've also tried switching to an element further down that is of a custom xtype called 'htmleditors' and when attempting to use:

    Code:
    this.control({
        'htmleditors' : {
            afterrender: this.onEditorRender
        }
    });
    Still with no luck. This is the first issue we've had with a controller not working correctly. I've even went so far as to try and attach the afterrender listener to the xtype "panel". We know the controller is being loaded since if you place a console.log() inside the init() function it is logged correctly.

  7. #6
    Sencha User
    Join Date
    Feb 2012
    Posts
    25
    Answers
    2

    Default

    Tobiu,

    We have fixed this now. The issue was in the Layout of our HTML page (being rendered via Zend Framework). Within this layout we had set the app.js for this Ext App to run but had failed to remove the app.js from another application (also available on this server). Since the secondary app.js was causing the controllers for the other application to load it was interfering in same way with registering the event listeners.

    I also extracted the tabpanel and child htmleditor element into its own component to clean up the viewport and get away from using the ID in the Ext Controller.

    Our resulting (and functioning) code now looks like this:

    https://gist.github.com/anonymous/3ff34b82522eb038c3f6

Tags for this Thread

Posting Permissions

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