PDA

View Full Version : How to modify the iconcls using validator?



bbarani
17 Feb 2012, 6:48 AM
Hi,

I am pretty new to EXTJs, I am using validator in numeric field to validate the data entered by the user. something like below.

validator: function(val) {
if (me.crossValidationFields.ExceptionWithPayload){
if(val > (me.crossValidationFields.ExceptionWithPayload.guiPayloadMarkup.value)){
return 'Severe';
}else{
return true;
}
}
}

I would like to show different icons for different messages, I am not sure how to achieve that using validator.

i.e if the return value is 'Severe' I would like to show a new iconcls beside the error message. Can someone help me with some ideas?

Thanks,
BB

mitchellsimoens
17 Feb 2012, 6:58 AM
You would have to get the error element off of the field instance and add a class to it.