Mohammed shafeek
Mohammed shafeek

Reputation: 197

How to enter non english letters in a combobox?

Can you please tell me, how to enter Hindi letters in a Extjx(3.2) combo-box.

For Example:-

if user entered English letter "A" in the combo-box then i need to convert this to Hindi letter "अ" and show the filtered results in the combo-box.

Note:-

I am taking all Hindi data from postgreSQL and populating in the combo-box. Only i need client side filtering.

Thanks & Regards

Mohammed Shafeek

Upvotes: 1

Views: 113

Answers (1)

Mark Twain
Mark Twain

Reputation: 836

Something like this, if you want to change the display of the input value: http://jsfiddle.net/coshmos/H9Vck/

If you want only convert an input value and then display values in a combobox, you should use a backend.

Solution, if the jsfiddle is not accessible.

Ext.onReady(function () {
    var states = Ext.create('Ext.data.Store', {
        fields: ['abbr', 'name'],
        data: [{
            "abbr": "AL",
            "name": "अlabama"
        }, {
            "abbr": "AK",
            "name": "Alaska"
        }, {
            "abbr": "AZ",
            "name": "Arizona"
        }]
    });

    var combobox = Ext.create('Ext.form.ComboBox', {
        fieldLabel: 'Choose State',
        store: states,
        queryMode: 'local',
        displayField: 'name',
        valueField: 'abbr',
        renderTo: 'container'
    });

    combobox.on('change', function(combobox, newValue, oldValue, event) {
        combobox.setValue(newValue.replace('A', 'अ'));
    });
});

Upvotes: 1

Related Questions