-
3 Jun 2010 5:54 AM #1
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:
any idea / suggestion ?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. } } }
-
3 Jun 2010 6:46 AM #2
"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 Jun 2010 7:01 AM #3
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
-
ext.window title formatting
By jerrel in forum Ext 2.x: Help & DiscussionReplies: 3Last Post: 15 Jan 2010, 6:08 AM -
localizing login window
By ShailShin in forum Ext 3.x: Help & DiscussionReplies: 0Last Post: 7 Jul 2009, 1:33 AM -
Localizing Ext input fields
By S1-Gezi in forum Community DiscussionReplies: 0Last Post: 9 Dec 2008, 4:28 AM -
[SOLVED] Add an icon for title of ext.Window
By stevanovich in forum Ext 2.x: Help & DiscussionReplies: 6Last Post: 27 Nov 2008, 2:36 PM -
[Tutorial] Localizing Ext
By jsakalos in forum Ext 2.x: Help & DiscussionReplies: 0Last Post: 9 Mar 2008, 11:06 AM


Reply With Quote