Vincent Guesné
Vincent Guesné

Reputation: 776

Combobox don't recognize character '(' ')'

I store combobox withe few data like this :

var materialstore = Ext.create('Ext.data.Store',{

            //fields : [ 'id','data'],
            model :'Combox',
            data : [ 
            { "id" : "12270",
            "data" : "Basic Monthly Support Contract"}
             , 
            { "id" : "12261",
            "data" : "Business Analysis Hour"}
             ,
            { "id" : "12264",
            "data" : "Project/Consulting (Base System)"}

To updating my row , i need to do traitment to retieve id . i make function to do this, but when data field has an character like '(' or ')' , my function doesn't works !

In my function, i found valid store and i take id corresponding with data field

var store = Ext.getStore(eval(c));
                                    var index = store.findRecord('data',value);
                                    if ( index != null ) {
                                        var rg = new RegExp(value,'gi');
                                        tab = tab.replace(rg,index.get('id'));
                                    }

But when i have ')' in data field , the function don't return id but data field also than it works for other data ! Exist an extra character or other ?

Upvotes: 1

Views: 394

Answers (1)

It Grunt
It Grunt

Reputation: 3378

You might need to use the escape character codes for the left paren "(" and right paren ")"

See this ASCII Reference.

Upvotes: 1

Related Questions