1. #1
    Ext JS Premium Member
    Join Date
    Apr 2010
    Location
    Montréal, Canada
    Posts
    221
    Vote Rating
    5
    Christiand is on a distinguished road

      0  

    Default Ext.Window title localizing

    Ext.Window title localizing


    I'm setting up localization for a demo app. I am extending Ext.Window with a configurable base class and then extending this class.

    The translation works for the tbar and my listView column header. However, the window title appears blank. Consider the following code:

    Code:
    Ext.ns("SoL");
    
    // base class
    SoL.ExpWindowsBase = Ext.extend(Ext.Window,  {
    	draggable: true,
        width: 800,
        height: 400,
    	shim:false,
        animCollapse:false,
        constrainHeader:true,
        layout: 'fit',
    	
    	// Toolbar text to be translated
    	textGroupBy: 'Group By',
        textToolBarCategory: 'Category',
        textToolBarType: 'Type',
        textToolBarNone: 'None',
    	
    	
    	initComponent : function() {
    		Ext.apply(this, {
    		 // code for tbar removed.
    		}
    		SoL.ExpWindowsBase.superclass.initComponent.call(this, arguments);		
    	}	
    }
    
    SoL.PartsExplorer = Ext.extend(SoL.ExpWindowsBase, {
    	textWindowTitle: 'Window Title',
    	title: this.textWindowTitle,
    	
    	// Ext.listView column header text
    	textColHeaderName: 'Name',
        textColHeaderCat: 'Category',
        textColHeaderType: 'Type',
    	
    	createListView: function() {
    		return {
    		 // code for listView removed.
    		}
    	
    	}
    
    }
    any idea / suggestion ?

  2. #2
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    17,050
    Vote Rating
    657
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    "this" doesn't point to what you think it points to. The object isn't even created by the time you're calling this.textWindowTitle.

    Look at how Ext provides localization, this is how you want to do it.
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  3. #3
    Ext JS Premium Member
    Join Date
    Apr 2010
    Location
    Montréal, Canada
    Posts
    221
    Vote Rating
    5
    Christiand is on a distinguished road

      0  

    Default


    thanks! fixed my problem.

    it's a lot of reading and understanding when you are getting started. The documentation and firebug helps a lot Now I need better understanding of scopes.

Similar Threads

  1. ext.window title formatting
    By jerrel in forum Ext 2.x: Help & Discussion
    Replies: 3
    Last Post: 15 Jan 2010, 6:08 AM
  2. localizing login window
    By ShailShin in forum Ext 3.x: Help & Discussion
    Replies: 0
    Last Post: 7 Jul 2009, 1:33 AM
  3. Localizing Ext input fields
    By S1-Gezi in forum Community Discussion
    Replies: 0
    Last Post: 9 Dec 2008, 4:28 AM
  4. [SOLVED] Add an icon for title of ext.Window
    By stevanovich in forum Ext 2.x: Help & Discussion
    Replies: 6
    Last Post: 27 Nov 2008, 2:36 PM
  5. [Tutorial] Localizing Ext
    By jsakalos in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 9 Mar 2008, 11:06 AM

Thread Participants: 1

Tags for this Thread