1. #1
    Ext User
    Join Date
    Oct 2007
    Posts
    27
    Vote Rating
    0
    thzero is on a distinguished road

      0  

    Default CountryField

    CountryField


    Here is a country field combobox that displays a small flag icon next to the right of the combobox.

    To install, just unzip to the your ext script folder and see the examples\form\country.html for an example. To use the contol, just include the following two javascripts:

    ux\widgets\form\CountryField.js
    ux\widgets\form\CountryFieldStore.js

    and the following style sheet:

    resources\css\ext-ux-countryfield.css

    A quick example of creating a CountryField is as follows:

    Code:
    new Ext.ux.CountryField({
                    fieldLabel: 'Country',
                    name: 'country',
                    maxHeight: 200,
                    typeAhead: true
    });
    By default the control uses the local store defined in the CountyFieldStore.js, if you want to use your own custom store (local or remote) just define, as normal, a 'store' property and a 'mode' property, etc.

    The download is available from http://www.thzero.com/programming/ex...untryField.zip as it is too big [240kb] too attach (due to the country images included).
    Attached Images

  2. #2
    Sencha User
    Join Date
    May 2007
    Posts
    191
    Vote Rating
    0
    temporary is on a distinguished road

      0  

    Default


    Nice. Can the countries be easily translated?

  3. #3
    Ext User
    Join Date
    Oct 2007
    Posts
    27
    Vote Rating
    0
    thzero is on a distinguished road

      0  

    Default


    Sure, supply your own store based on the language you want displayed.

  4. #4
    Sencha User
    Join Date
    Mar 2007
    Posts
    464
    Vote Rating
    1
    JorisA is on a distinguished road

      0  

    Default


    Looks nice, but you might want to have a look at this:
    http://extjs.com/learn/Tutorial:Extending_Ext_Class

Thread Participants: 2