1. #1
    Sencha User
    Join Date
    Sep 2008
    Posts
    81
    Vote Rating
    0
    vitolini is on a distinguished road

      0  

    Default Setting PagingBar Locale

    Setting PagingBar Locale


    My form already includes dynamic localization implemented with php, in my paging bar I could change "Displaying Records 1-10 of 20" which prints at right corner of the paging bar with the current language settings by setting displayMsg property. And tehre are other properties also to allow changing default texts.

    I also studied the dynamic locale sample at http://www.extjs.com/deploy/dev/exam...ulti-lang.html , but I really couldn't figure out how changing the language combobox value propogates to the paging bar. I understand that, that specific one is a user extension written to enable paging in memory data, is setting the locale also specific to this extension? or is there a way to set the locale easily or should I change every text in the config of the paging bar?

    Thanks,

    Vito

  2. #2
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    96
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      0  

    Default


    Changing the text prototype doesn't change what is already rendered on the screen.

    The best solution is probably to rerender the entire screen.

    Otherwise you would need to update all language dependent elements, e.g.
    myPagingToolbar.updateInfo();

  3. #3
    Sencha User
    Join Date
    Sep 2008
    Posts
    81
    Vote Rating
    0
    vitolini is on a distinguished road

      0  

    Default


    Condor,

    There is no requirement to change what's already on the screen. When the page is being rendered, it simply checks in "lang" parameter and renders all the texts based on that parameter. Normally we have all the language dependent text in the DB, my questions comes down to... Do I have to create 6-7 different texts for each language we support to enable setting FirstMsg, LastMsg etc... of the PagingBar, or is there a simple way to call a function on pagingbar to let it use the passed language parameter and obtain its texts from a language file.

    The aformentioned dynamic locale sample, for some reasons, made me believe that there is an easier built-in way than setting all these parameters one by one, please correct me if I am wrong.

  4. #4
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    96
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      0  

    Default


    Did you look inside the locale files?
    Code:
    if(Ext.PagingToolbar){
      Ext.apply(Ext.PagingToolbar.prototype, {
        beforePageText : "Page",
        afterPageText  : "of {0}",
        firstText      : "First Page",
        prevText       : "Previous Page",
        nextText       : "Next Page",
        lastText       : "Last Page",
        refreshText    : "Refresh",
        displayMsg     : "Displaying {0} - {1} of {2}",
        emptyMsg       : 'No data to display'
      });
    }
    The only way to get the localized texts is to actually load the scriptfile and have them applied to the prototypes.

  5. #5
    Sencha User
    Join Date
    Sep 2008
    Posts
    81
    Vote Rating
    0
    vitolini is on a distinguished road

      0  

    Default


    oh ok thank you, so it's doing the same thing anyways [relief sigh]

Thread Participants: 1