---
title: "Sencha Touch Ext.picker setData not working correctly"  
description: "Sencha Touch Ext.picker setData not working correctly"  
author: "Anonymous User"  
published: 2013-05-31  
updated: 2013-06-01  
canonical: https://www.mindstick.com/forum/950/sencha-touch-ext-picker-setdata-not-working-correctly  
category: "sencha touch"  
tags: ["sencha touch"]  
reading_time: 2 minutes  

---

# Sencha Touch Ext.picker setData not working correctly

Hi [Expert](https://www.mindstick.com/articles/13120/an-expert-financial-advice-will-improve-your-finances)!\
I have been trying to figure out why I am not able to update the [Sencha Touch](https://www.mindstick.com/interview/23004/define-class-system-of-sencha-touch) picker [data field](https://www.mindstick.com/forum/160/problem-in-get-and-set-the-data-field) (see the code at the end of post) using setData [method](https://www.mindstick.com/forum/166/webservice-method). I created an array called slotsdata where I defined my data. The data look exactly like this:\
{text: '50 KB/s', value: 50}, {text: '100 KB/s', value: 100}, {text: '200 KB/s', value: 200}, {text: '300 KB/s', value: 300} When I tried to set the data using setData() picker.setData(slotsdata); No error are displayed but picker does not display any data.\
When I [tried to update](https://answers.mindstick.com/qa/94326/i-don-t-see-emoticons-on-skype-windows-i-tried-to-update-what-might-the-problem-be) the data like this:slots: [{name : 'picker_slot1',title: 'slot1',data: [slotsdata]}] It does not work. No errors in the console. The picker is empty.\
The only way I can update is using this syntax:\
slots: [{name : 'picker_slot1',title: 'slot1',data: slotsdata}]\
I would like to be able to update my picker data using method #1. Can [anyone help me](https://www.mindstick.com/forum/331/can-anyone-help-me-out-how-to-use-session-concept) with this issue. Any help will be appreciated.\
This is the code:\
myFunction: [function](https://www.mindstick.com/articles/13001/multi-statement-table-valued-user-defined-function-in-sql-server)(){ var data = this.getData(); var slotsdata = []; var pickerData = data.dosage.split(','); for( var i = 0; i < pickerData.length; i++ ){ slotsdata.push({text: pickerData[i], value: pickerData[i]}) } var picker = Ext.create('Ext.Picker', { slots: [ { name : 'picker_slot1', title: 'slot1', data: slotsdata } ] }); //this does not work //picker.setData(slotsdata); }\
Thanks in [advance](https://www.mindstick.com/blog/33258/jee-mains-and-jee-advance-exams)!

## Replies

### Reply by AVADHESH PATEL

Hi Jacob!\
You can use setSlots() method of picker class like:\

```
picker.setSlots({    name: 'limit_speed',    title: 'Speed',    data: [        { text: '50 KB/s', value: 50 },        { text: '100 KB/s', value: 100 }    ]}); 
```

\
I hope it helpful for you.


---

Original Source: https://www.mindstick.com/forum/950/sencha-touch-ext-picker-setdata-not-working-correctly

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
