Results 1 to 2 of 2

Thread: How can I read a variable ouside 'bundle.onReady()' in Ext.i18n.Bundle ?

  1. #1
    Sencha User
    Join Date
    Feb 2011
    Location
    Gurgaon, Haryana, India
    Posts
    7

    Default How can I read a variable ouside 'bundle.onReady()' in Ext.i18n.Bundle ?

    I will be calling the below functions as below from my code:

    var page_title = getBundleMsg('lbl_page_title');


    I have this code ExtJs code:

    ***********************
    getBundleMsg = function(lableKey) {
    var msg;
    var lang;

    var params = Ext.urlDecode(window.location.search.substring(1));
    if(params.lang) {
    lang = params.lang;
    }
    var bundle = new Ext.i18n.Bundle({bundle:'Application', path:'resources', lang: lang});
    bundle.onReady(function(){

    msg = bundle.getMsg(lableKey);
    alert('1 = ' + msg); <== the msg has correct value in alert
    });

    alert('2 = ' + msg); <== but here the read value is lost, I get 'undefined'
    return msg;
    };
    ***********************


    Can somebody suggest, how I can read the value of variable 'msg' outside 'bundle.onReady()' ?

  2. #2
    Sencha User
    Join Date
    Apr 2008
    Location
    Buenos Aires, Argentina
    Posts
    67

    Default

    Ext.i18n.Bundle is not part of ExtJS nor Sencha in itself. But, I can help you if you need more info go to: http://gaver.dyndns.org/elmasse/site...tjs-extension-
    Or contact me if that is not clear.

    Regards.

    Max

Similar Threads

  1. Ext.i18n.Bundle Using Bundles now for Sencha Touch 1.0
    By elmasse in forum Sencha Touch 1.x: Examples and Showcases
    Replies: 14
    Last Post: 19 Jan 2012, 4:42 AM
  2. Resource Bundle
    By sundhar_v in forum Ext GWT: Discussion
    Replies: 1
    Last Post: 16 Sep 2009, 7:38 AM
  3. Image Bundle in GXT
    By markrgli in forum Ext GWT: Discussion
    Replies: 1
    Last Post: 17 Aug 2009, 11:11 PM
  4. Is there an Ext.js 2.0 Textmate Bundle?
    By Dumbledore in forum Community Discussion
    Replies: 8
    Last Post: 10 Jan 2009, 6:31 PM
  5. Image bundle
    By papasi in forum Community Discussion
    Replies: 4
    Last Post: 2 Jul 2007, 1:04 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
  •