

Tenho um grid editor e gostaria de verificar se o valor que está sendo editado já existe no store .
Caso existir ele deve dizer ao usuário que valor já foi cadastrado.
Segue o grid:
this.amostraGrid = new Ext.grid.EditorGridPanel ({ title: 'Amostras' , store: this.amostraStore , border: false , height: 200 ,loadMask : true , selModel: new Ext.grid.RowSelectionModel({singleSelect:false}) , clicksToEdit: 1 //, tbar: ['Nova amostra:', ' ' , this.amostraMaterial, ' ', this.amostraNumero,' ', this.amostraColeta, ' ', this.amostraAntib, ' ', this.amostraIncluir, '-', this.amostraExcluir] ,tbar: new Ext.Panel({ items: [{ xtype: 'toolbar', items: ['Nova amostra:', ' ' , this.amostraMaterial, ' ',this.localizacaoMaterial ,' ',this.amostraNumero, ' ', this.materialClinico ] }, { xtype: 'toolbar', items: ['<!--p style="padding-right: 80px;"-->',this.amostraColeta, ' ',this.amostraHoraColeta,' ','Medicamento:',' ', this.amostraAntib,'',this.medicamento] }, { xtype: 'toolbar', items: ['<!--p style="padding-right: 80px;"-->', this.dtInicioUsoMedicamento,'',this.amostraIncluir, '-', this.amostraExcluir] }] }) , columns: [{ header: 'Material' , dataIndex: 'nomeMaterial' , width: 200 , sortable: true , editor: this.amostraMaterialEditor //, hidden : true },{ header: 'Localização' , dataIndex: 'nomeLocalizacao' , width: 200 , sortable: true , editor: this.localizacaoMaterialEditor //, hidden : true },{ header: 'Amostra' , dataIndex: 'amostra' , sortable: true , renderer: function(value, meta, record, rIn, cIn, store){ if (value == 'U' || value == 'u' || value == 0) { return 'Única'; } else { return value + 'ª amostra'; } } , width: 100 , editor: this.amostraNumeroEditor },{ header: 'Material Clínico' , dataIndex: 'codigoMaterialClinico' , editor: this.materialClinicoEditor , width: 150 , sortable: true ,renderer: function(val){ switch (val) { case 1: return 'Amostra "in natura"'; case 2: return 'Isolado Bacteriano'; case 3: return 'L\xE2mina'; case 4: return 'Em Meio de Transporte Bacteriano ' case 5: return 'Em Meio de Transporte Viral' case 6: return 'FF - Fixado em formol' case 7: return 'FA - Fixado em álcool' case 8: return 'FO - Fixado - outros' case 9: return 'BP - Bloco de Parafina' case 10: return 'PF - Em papel de filtro' } } },{ header: 'Data de Coleta' , dataIndex: 'dataColeta' , width: 100 , editor: this.amostraColetaEditor , sortable: true , renderer: function(valor){ if((valor.length)== 10){ return valor; }else{ return valor.format('d/m/Y') } } },{ header: 'Hora da Coleta' , dataIndex: 'horaColeta' , editor: this.amostraHoraColetaEditor , width: 90 , sortable: true },{ header: 'Usou medicamento?' , dataIndex: 'codigoUsouAntib' , editor: this.amostraAntibEditor , width: 110 , sortable: true ,renderer: function(val){ switch (val) { case 1: return 'Sim'; case 2: return 'Não'; case 9: return 'Ignorado'; } } },{ header: 'Medicamento' , dataIndex: 'descAntibiotico' , editor: this.medicamentoEditor , width: 155 , sortable: true },{ header: 'Data de Inicio do Uso' , dataIndex: 'dtInicioUsoAntibiotico' , width: 100 , editor: this.dtInicioUsoMedicamentoEditor , sortable: true , renderer: function(v){ if(v != null){ if((v.length)== 10){ return v; }if(v == ''){ return v; }else{ return v.format('d/m/Y') } } } }] });
O valor que quero verificar são os valores da Amostra
Espero que me ajudem .