BackgroundTeam
17 Apr 2012, 2:37 AM
Good morning to everyone,
I have this code:
var picker = Ext.Viewport.add({
xtype: 'picker',
slots: [{
name: 'years',
title: 'Select age',
data: [
{ text: '1910s', value: 1910 },
{ text: '1920s', value: 1920 },
{ text: '1930s', value: 1930 },
{ text: '1940s', value: 1940 },
{ text: '1950s', value: 1950 },
{ text: '1960s', value: 1960 },
{ text: '1970s', value: 1970 },
{ text: '1980s', value: 1980 },
{ text: '1990s', value: 1990 },
{ text: '2000s', value: 2000 },
{ text: '2010s', value: 2010 }
]
}],
listeners: {
change: function(){
console.log(picker.getValue());
}
}
}).show();
How do I get the value of the slot I selected. When I do this, I get this in the console:
[Object object], and not, for example: 1910.
Thank you very much in advance.
I have this code:
var picker = Ext.Viewport.add({
xtype: 'picker',
slots: [{
name: 'years',
title: 'Select age',
data: [
{ text: '1910s', value: 1910 },
{ text: '1920s', value: 1920 },
{ text: '1930s', value: 1930 },
{ text: '1940s', value: 1940 },
{ text: '1950s', value: 1950 },
{ text: '1960s', value: 1960 },
{ text: '1970s', value: 1970 },
{ text: '1980s', value: 1980 },
{ text: '1990s', value: 1990 },
{ text: '2000s', value: 2000 },
{ text: '2010s', value: 2010 }
]
}],
listeners: {
change: function(){
console.log(picker.getValue());
}
}
}).show();
How do I get the value of the slot I selected. When I do this, I get this in the console:
[Object object], and not, for example: 1910.
Thank you very much in advance.