PDA

View Full Version : need help manipulate form items css on edit mode or normal



asher2007
10 Jun 2012, 11:26 PM
need help manipulate form items css on edit mode or normal
i have a umber field inside a form and i need to change its css according to state of the form using only css no js
i have partaly succeeded with text fields and combo its work great however with number i cannot mange
what i am trying to do is hid the triggers if i am on normal mode and present them if i am in edit mode
will appreciate any help :)

scottmartin
11 Jun 2012, 8:50 AM
You should be able to use setHideTrigger

Note: setHideTrigger was not working in earlier versions, but is working in the latest build.
You can also use setReadOnly



var form = Ext.create('Ext.form.Panel', {
title: 'On The Wall',
width: 300,
bodyPadding: 10,
renderTo: Ext.getBody(),
items: [{
xtype: 'numberfield',
anchor: '100%',
name: 'bottles',
fieldLabel: 'Bottles of Beer',
value: 99,
maxValue: 99,
minValue: 0
}]
});

var nf = form.down('numberfield');
//nf.setReadOnly(true);
nf.setHideTrigger(true);


Regards,
Scott.

asher2007
13 Jun 2012, 2:34 AM
i am using extjs 4.1 which doesn't support this methods
or at least doesn't work for me...
any alternatives???

scottmartin
13 Jun 2012, 11:44 AM
The next public release should have this corrected. You can also access this from the Support portal if you have a subscription.

Regards,
Scott.