-
3 Jan 2012 10:36 AM #1
Answered: UI Issue with selectfield when disabled in iPhone
Answered: UI Issue with selectfield when disabled in iPhone
hi,
There is a UI problem that i have been observing when selectfield is disabled. The masking at the end of the field(where a down arrow is present) is not complete. Is there a way to mask it completely as a mask on textfield(where mask is complete). I observed the problem in iphone,
Hoping for a reply.
-
Best Answer Posted by mitchellsimoens
Ok... turns out it was the useClearIcon element that was causing this. Try this override:
This will affect any subclass of Ext.form.Field but those subclasses that don't have a clear icon won't error out. This actually had nothing to do with the select field.Code:Ext.form.Field.override({ onEnable: function() { if (this.clearIconContainerEl) { this.clearIconContainerEl.show(); } this.fieldEl.dom.disabled = false; }, onDisable : function() { if (this.clearIconContainerEl) { this.clearIconContainerEl.hide(); } this.fieldEl.dom.disabled = true; } });
-
3 Jan 2012 10:45 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,656
- Vote Rating
- 435
- Answers
- 3108
It is masked... you can't click on it. It has the CSS set as zero to these properties of the mask which will always mask the entire field: top, right, bottom, left.
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
4 Jan 2012 2:52 AM #3
The problem can be clearly understood from this image.
The problem can be clearly understood from this image.
IMG_1019.PNG
UI problem can be seen from the image. That is a fieldset in a form. When form is disabled. The masking is not proper at the end of the fields. Any suggestions or workarounds would be greatly helpful
-
4 Jan 2012 5:37 AM #4Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,656
- Vote Rating
- 435
- Answers
- 3108
Can I get your code as any code I am producing doesn't have this behavior.
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
4 Jan 2012 6:44 AM #5
Here is the code.
Here is the code.
@mitchellsimoens here is the code.
App.views.SettingsFormView = {
xtype: 'formpanel',
scroll: 'vertical',
id: 'settingsform',
dockedItems: [{
xtype: 'toolbar',
title: 'Settings',
dock: 'top',
items: [{
xtype: 'spacer'
},{
xtype: 'button',
text: 'edit',
ui: 'action',
id: 'savesettings',
handler: function(button, event) {
if(button.getText() == 'edit') {
App.Viewport.down('#settingsform').enable();
button.setText('save');
}
else if(button.getText() == 'save') {
if all valid fields {
App.Viewport.down('#settingsform').disable();
button.setText('edit');
}
else {
// show errors for fields.
}
}
}
}]
}],
items: [{
xtype: 'fieldset',
id: 'billingdetails',
title: 'Billing Details',
defaults: {
listeners: {
change: function(curobj,newValue,oldValue) {
if(newValue != oldValue) {
var setvp = App.Viewport
setvp.down('#settingsform').updateRecord(setvp.down('#settingsform').getRecord());
}
}
}
},
items: [{
xtype: 'textfield',
name: 'name',
label: 'Name',
id: 'billname',
useClearIcon: true
},{
xtype: 'textfield',
name: 'address',
label: 'Address',
id: 'addr1',
useClearIcon: true
},{
xtype: 'textfield',
name: 'city',
label: 'City',
id: 'billcity',
useClearIcon: true
},{
xtype: 'selectfield',
name: 'state',
label: 'State',
id: 'billstate',
store: App.stores.States,
displayField: 'StateName',
valueField: 'StateCode'
},{
xtype: 'selectfield',
id: 'country',
name: 'country',
label: 'Country',
store: App.stores.Countries,
displayField: 'CountryName',
valueField: 'CountryCode'
},{
xtype: 'numberfield',
name: 'zipcode',
label: 'Zip',
id: 'zip',
useClearIcon: true
},{
xtype: 'zipfield',
name: 'phoneno',
id: 'phoneno',
label: 'Number',
useClearIcon: true
}]
}],
listeners: {
render: function(curobj) {
curobj.disable();
}
}
};
thanq u!!!
-
4 Jan 2012 7:11 AM #6Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,656
- Vote Rating
- 435
- Answers
- 3108
Ok... turns out it was the useClearIcon element that was causing this. Try this override:
This will affect any subclass of Ext.form.Field but those subclasses that don't have a clear icon won't error out. This actually had nothing to do with the select field.Code:Ext.form.Field.override({ onEnable: function() { if (this.clearIconContainerEl) { this.clearIconContainerEl.show(); } this.fieldEl.dom.disabled = false; }, onDisable : function() { if (this.clearIconContainerEl) { this.clearIconContainerEl.hide(); } this.fieldEl.dom.disabled = true; } });Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
4 Jan 2012 10:37 AM #7
Any other alternatinve/
Any other alternatinve/
hi,
the problem still seems to exist. I tried with the above override but it doesn't change anything.. Any alternative would be greatly helpful. thanks
-
4 Jan 2012 10:41 AM #8Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,656
- Vote Rating
- 435
- Answers
- 3108
I tried it on both my iPhone and the iOS simulator and the mask stretched because of the clear icon was still taking space but with that override it worked for me.
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
6 Jan 2012 11:32 PM #9
It's Working!
It's Working!
Thank u mitchelsimeons! For some reason i was unable to get it at first, but it is working fine now.
-
12 Apr 2012 10:19 PM #10
The code didn't work for me, what did you do to make it works?


Reply With Quote