PDA

View Full Version : Problem loading select form field



logicmedia
4 Dec 2010, 11:20 PM
Hi all,

I have a simple problem loading a select form field - this used to work back around the 0.97/0.98 release and I just noticed yesterday that it didn't work anymore.

I have this test code:



Ext.setup({
icon: 'icon.png',
glossOnIcon: false,
tabletStartupScreen: 'tablet_startup.png',
phoneStartupScreen: 'phone_startup.png',
onReady: function() {
var tp = new Ext.form.FormPanel({
fullscreen: true,
type: 'dark',
sortable: true,
items: [{
xtype: 'fieldset',
itemId: 'id_form',
title: 'Hmmmmmm',
items: [{
xtype: 'selectfield',
itemId: 'id_form_inspectionListDays',
label: 'Days',
name: 'inspectionListDays',
options: [
{text: 'All', value: '0'},
{text: '1 week', value: '7'},
{text: '2 weeks', value: '14'},
{text: '3 weeks', value: '21'},
{text: '1 month', value: '31'},
{text: '2 months', value: '62'},
{text: '3 months', value: '93'}
],
scope: this
}]
}]
});

tp.setValues({ "inspectionListDays": 7 });
}
});
My problem is that the select-box displays a 7 and not the string "1 week". How do I load the select field so that it displays the string "1 week" when I load the value 7 into the field?? What am I missing?

Regards,

Thomas

tomalex0
5 Dec 2010, 4:07 AM
try this


tp.setValues({ "inspectionListDays": '7' });



OR

change the values of select field to integer