Results 1 to 3 of 3

Thread: How can I set the Application renderTo property?

  1. #1
    Sencha Premium Member
    Join Date
    Jan 2010
    Location
    Vancouver, Canada
    Posts
    262
    Answers
    4

    Default Answered: How can I set the Application renderTo property?

    Hi:

    My goals is similar to the one posted on this thread. I want to render my application to a specific div.

    SenchaArchitect generates by default this code:

    Code:
    // @require @packageOverrides
    Ext.Loader.setConfig({
    
    });
    
    
    Ext.application({
      views: [
        'NotificationForm',
        'AddAttachmentWindow',
        'EventAttachments'
      ],
      controllers: [
        'NotificationsController'
      ],
      name: 'NotificationsApp',
    
    
      launch: function() {
        Ext.create('NotificationsApp.view.NotificationForm', {renderTo: Ext.getBody()});
      }
    
    
    });
    How can I override in SenchaArchitect the renderTo property to point to my div?

    In other words, I want to have: renderTo: 'extJsRoot' instead of the other one.

    If I add the renderTo property to the Application object, the renderTo to the body still takes precendence. The only way, currently, is to change the code after generating it using Sencha Cmd.

    Update: ok, I thought I found the solution - set the launch method for the Application, but upon saving SA still adds a default line:

    Code:
      launch: function() {
        Ext.create('NotificationsApp.view.NotificationForm', {renderTo: Ext.getBody()}); // <- SA still inserts this line
            Ext.create('NotificationsApp.view.NotificationForm', {renderTo: 'extJsRoot'}); //<- I added this line
      }
    Thanks

  2. ok, I found it, I set the initialView property to false for the form and SA removed the line.

  3. #2
    Sencha Premium Member
    Join Date
    Jan 2010
    Location
    Vancouver, Canada
    Posts
    262
    Answers
    4

    Default

    ok, I found it, I set the initialView property to false for the form and SA removed the line.

  4. #3
    Sencha User
    Join Date
    Sep 2014
    Location
    Central Europe
    Posts
    795
    Answers
    103

    Default

    Yep, find the NotificationsApp.view.NotificationForm in the left menu between classes and disable it as initial view.

Similar Threads

  1. Replies: 1
    Last Post: 4 Aug 2015, 1:48 AM
  2. [FIXED] Can't add dot in application's name property
    By yAdEs in forum Sencha Architect 2.x: Bugs
    Replies: 5
    Last Post: 10 May 2013, 7:59 AM
  3. using property 'renderTo' in Ext.List causing problem in android
    By yehudagoldner in forum Sencha Touch 2.x: Discussion
    Replies: 3
    Last Post: 6 Jul 2012, 5:43 AM
  4. GridPanel renderTo property
    By balaji1_1 in forum Ext 3.x: Help & Discussion
    Replies: 1
    Last Post: 16 Sep 2010, 6:46 AM
  5. Replies: 3
    Last Post: 16 Jul 2009, 9:49 AM

Posting Permissions

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