Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

javascript : check for duplicates

Avatar of royjayd
royjayd asked on
JavaScript
11 Comments1 Solution154 ViewsLast Modified:
hi experts

I am using EXT-Js 4.2 code to design some UI for my project.

I have set a renderer in my javascript code for a grid column

function firstnameRenderer(val) {       
if(same firstname occurs twice , then color the two firstname with orange){ 
return '<span style="color:orange;">' + val + '</span>';	
}else{
    return val;
} 
} 
....
....
{
        id:'myGrid',
        xtype : 'grid', 
        stripeRows: true,
        
        title: 'User Information',
        store: Ext.data.StoreManager.lookup('mystore'),         
        autoHeight: true,
        plugins: [ cellEditing ],
        columns: [            
            {header: "First Name", width: 100, dataIndex: 'firstname', renderer: firstnameRenderer, sortable: true}
             


...
I want to check if a same firstname appears twice, if yes color it with orange.
Any idea how firstnameRenderer() function above should change ?

Thanks
ASKER CERTIFIED SOLUTION
Avatar of leakim971
leakim971Flag of Guadeloupe imageMultitechnician
Commented:
This problem has been solved!
Unlock 1 Answer and 11 Comments.
See Answers