xnakxx
30 Nov 2010, 3:45 PM
PMZ.Search = new Ext.form.FormPanel({
scroll: 'vertical',
items: [{
xtype: 'fieldset',
title: 'Choose your options...',
instructions: 'Please enter the information above.',
items: [{
xtype: 'select',
id: 'priceMin',
name: 'priceMin',
label: 'Min Price',
listeners: {
change: function(t,v){
if (parseInt(Ext.getCmp('priceMin').getValue()) > parseInt(Ext.getCmp('priceMax').getValue()))
{
Ext.getCmp('priceMax').setValue(parseInt(Ext.getCmp('priceMin').getValue())+50000);
}
}
},
options: [{
text: '$0',
value: '0'
},
{
text: '$50,000',
value: '50000'
}, {
text: '$100,000',
value: '100000'
},{
text: '$150,000',
value: '150000'
}, {
text: '$200,000',
value: '200000'
}, {
text: '$250,000',
value: '250000'
}, {
text: '$300,000',
value: '300000'
}, {
text: '$350,000',
value: '350000'
}, {
text: '$400,000',
value: '400000'
}, {
text: '$450,000',
value: '450000'
}, {
text: '$500,000',
value: '500000'
}, {
text: '$550,000',
value: '550000'
}, {
text: '$600,000',
value: '600000'
}, {
text: '$650,000',
value: '650000'
}]
},
{
xtype: 'select',
id: 'priceMax',
name: 'priceMax',
label: 'Max Price',
listeners: {
change: function(t,v){
if (parseInt(Ext.getCmp('priceMax').getValue()) < parseInt(Ext.getCmp('priceMin').getValue()))
{
Ext.getCmp('priceMin').setValue(parseInt(Ext.getCmp('priceMax').getValue()));
}
}
},
options: [{
text: '$50,000',
value: '50000'
}, {
text: '$100,000',
value: '100000'
},{
text: '$150,000',
value: '150000'
}, {
text: '$200,000',
value: '200000'
}, {
text: '$250,000',
value: '250000'
}, {
text: '$300,000',
value: '300000'
}, {
text: '$350,000',
value: '350000'
}, {
text: '$400,000',
value: '400000'
}, {
text: '$450,000',
value: '450000'
}, {
text: '$500,000',
value: '500000'
}, {
text: '$550,000',
value: '550000'
}, {
text: '$600,000',
value: '600000'
}, {
text: '$650,000',
value: '650000'
}]
}]
});
using alerts i can see the change event firing, i can also get the values of the selects but it silently ignores me when i try the setValue().
initially (past sencha touch version) i was listening to the "select" event but have since changed to the "change" event.
scroll: 'vertical',
items: [{
xtype: 'fieldset',
title: 'Choose your options...',
instructions: 'Please enter the information above.',
items: [{
xtype: 'select',
id: 'priceMin',
name: 'priceMin',
label: 'Min Price',
listeners: {
change: function(t,v){
if (parseInt(Ext.getCmp('priceMin').getValue()) > parseInt(Ext.getCmp('priceMax').getValue()))
{
Ext.getCmp('priceMax').setValue(parseInt(Ext.getCmp('priceMin').getValue())+50000);
}
}
},
options: [{
text: '$0',
value: '0'
},
{
text: '$50,000',
value: '50000'
}, {
text: '$100,000',
value: '100000'
},{
text: '$150,000',
value: '150000'
}, {
text: '$200,000',
value: '200000'
}, {
text: '$250,000',
value: '250000'
}, {
text: '$300,000',
value: '300000'
}, {
text: '$350,000',
value: '350000'
}, {
text: '$400,000',
value: '400000'
}, {
text: '$450,000',
value: '450000'
}, {
text: '$500,000',
value: '500000'
}, {
text: '$550,000',
value: '550000'
}, {
text: '$600,000',
value: '600000'
}, {
text: '$650,000',
value: '650000'
}]
},
{
xtype: 'select',
id: 'priceMax',
name: 'priceMax',
label: 'Max Price',
listeners: {
change: function(t,v){
if (parseInt(Ext.getCmp('priceMax').getValue()) < parseInt(Ext.getCmp('priceMin').getValue()))
{
Ext.getCmp('priceMin').setValue(parseInt(Ext.getCmp('priceMax').getValue()));
}
}
},
options: [{
text: '$50,000',
value: '50000'
}, {
text: '$100,000',
value: '100000'
},{
text: '$150,000',
value: '150000'
}, {
text: '$200,000',
value: '200000'
}, {
text: '$250,000',
value: '250000'
}, {
text: '$300,000',
value: '300000'
}, {
text: '$350,000',
value: '350000'
}, {
text: '$400,000',
value: '400000'
}, {
text: '$450,000',
value: '450000'
}, {
text: '$500,000',
value: '500000'
}, {
text: '$550,000',
value: '550000'
}, {
text: '$600,000',
value: '600000'
}, {
text: '$650,000',
value: '650000'
}]
}]
});
using alerts i can see the change event firing, i can also get the values of the selects but it silently ignores me when i try the setValue().
initially (past sencha touch version) i was listening to the "select" event but have since changed to the "change" event.