PDA

View Full Version : [FIXED] pickerslot data: Where to enter in Architect 2?



kreftt
19 Apr 2012, 6:59 AM
Hello,

I have just a very basic knowledge of javascript and the whole mvc system.

I'm currently trying to upgrade an app to Sencha Touch 2 using the Architect 2 ideally using best practices. My app includes a single form control which is a custom picker to choose weight and age. In Touch 1.1. I just did:


var weightAgePicker = new Ext.Picker({ fullscreen: true,
floating: false,
cancelButton: false,
slots: [
{
name : 'weight_kg',
title: 'kg',
data : [
{text: '0 kg', value: 0},
{text: '1 kg', value: 1},
{text: '2 kg', value: 2},
{text: '3 kg', value: 3},
{text: '4 kg', value: 4},
{text: '5 kg', value: 5},
{text: '6 kg', value: 6},
{text: '7 kg', value: 7},
{text: '8 kg', value: 8},
{text: '9 kg', value: 9},
{text: '10 kg', value: 10},
]
} ,
{
name : 'age_years',
title: 'Jahre',
data : [
{text: '0 Jahre', value: 0},
{text: '1 Jahr', value: 1},
{text: '2 Jahre', value: 2},
{text: '3 Jahre', value: 3},
{text: '4 Jahre', value: 4},
{text: '5 Jahre', value: 5},
{text: '6 Jahre', value: 6},
{text: '7 Jahre', value: 7},
{text: '8 Jahre', value: 8},
{text: '9 Jahre', value: 9},
{text: '10 Jahre', value: 10},
{text: '11 Jahre', value: 11},
{text: '12 Jahre', value: 12},
{text: '13 Jahre', value: 13},
{text: '14 Jahre', value: 14},
{text: '15 Jahre', value: 15},
{text: '16 Jahre', value: 16},
{text: '17 Jahre', value: 17}
]
}
],
doneButton: {
text: 'Absenden',
handler: function () {
var weight_kg = weightAgePicker.getValue()['weight_kg'];
var age_years = weightAgePicker.getValue()['age_years'];
weightAgePicker.hide();
}
},
listeners: {
pick: function(weightAgePicker) {
var weight_kg = weightAgePicker.getValue()['weight_kg'];
var age_years = weightAgePicker.getValue()['age_years'];
}
}
});


weightAgePicker.show();

The data: method seemed simple and did the job, the problem ist: I can't seem to find it in Sencha Architect 2. Do I have to setup stores, models etc. for just this one form control or did I just miss the function?

Thank you

jjohnston
19 Apr 2012, 8:08 AM
Thanks for bringing this to our attention; the missing 'data' config is a bug in Architect. I've opened a ticket to get it fixed in an upcoming patch release.