Hybrid View
-
14 Jun 2012 1:03 PM #1
Changing TextField style dynamically
Changing TextField style dynamically
I'm trying to set the background-color and color of a TextField (to mask a password) on a checkbox click event. My best try:
this code doesn't work. No errors are thrown. I'm not sure where to go from here. I've searched everywhere and can't find anything like this. I can't find any properties or methods to change the style that works.Code:var hidePass = new Ext.form.Checkbox({ xtype: 'checkbox', boxLabel: 'Hide Password', name: 'hidePass', handler: function (checkbox, checked) { if (checked) { pass1.fieldStyle = 'background-color: #ddd; background-image: none;'; } } });
-
14 Jun 2012 10:35 PM #2
Hi!
Try this:-
OR if above doesn't work....Code:YourTextField.setFieldStyle('background-color: red;');
Try to add a class, like this:-
CSS:-
Code:.changeColorRed{ background:red }Code:YourTextfield.addClass('changeColorRed'); // add red color YourTextfield.removeClass('changeColorRed'); // remove red colorsword-it.com, Sencha Developer House in Turkey - Istanbul University Technopark Suite 204.


Reply With Quote