PDA

View Full Version : [CLOSED] Picker -> setSlots bug



jairok
21 Oct 2011, 8:41 AM
Hi,

I try to set a picker's slot with some datas.


var seasonsPicker = this.getSeasonsPicker();
seasonsPicker.setSlots({
name : 'season',
title : 'Saison',
align : 'center',
data : [ {
text : 't1',
value : 1
}, {
text : 't2',
value : 2
} ]
});


But I get this error:




libs/sencha-touch-2.0.0-pr1/src/picker/Slot.js:243 (http://localhost:3000/mobile/libs/sencha-touch-2.0.0-pr1/src/picker/Slot.js)Uncaught TypeError: Cannot read property 'bar' of undefined



3

libs/sencha-touch-2.0.0-pr1/src/picker/Slot.js:307 (http://localhost:3000/mobile/libs/sencha-touch-2.0.0-pr1/src/picker/Slot.js)Uncaught TypeError: Cannot read property 'bar' of undefined






any suggestion ?

SunboX
22 Oct 2011, 1:53 AM
Have you tried to pass an array(!) of slots? In your example you passed a slot directly to "setSlots()".

Docs:

setSlots (http://cdn.sencha.io/touch/sencha-touch-2.0.0-pr1/docs/#%21/api/Ext.picker.Picker-method-setSlots)( Array (http://cdn.sencha.io/touch/sencha-touch-2.0.0-pr1/docs/#%21/api/Array) slots )
http://cdn.sencha.io/touch/sencha-touch-2.0.0-pr1/docs/#!/api/Ext.picker.Picker-method-setSlots

greetings Sunny

jairok
23 Oct 2011, 11:06 PM
I'll try...

jairok
24 Oct 2011, 10:03 PM
You were right. Just added the [ ] around the slot and it's ok.
Thanks

SunboX
24 Oct 2011, 11:07 PM
n.p.