View Full Version : spinnng data

09-24-2010, 06:54 AM
Hi Friends,
In ext-touch-debug.js file there is a function with the name Ext.Picker in which there is code for placing the values in the spinner. Here is the code
Ext.Picker = Ext.extend(Ext.Panel, {

for (i = 0, ln = this.slots.length; i < ln; i++) {
slot = this.slots[i]; // alert('i value is..... '+i);
//alert("display field is....."+this.displayField);
// key
slotItem = {
xtype: 'dataview',
itemSelector: this.pickerItemCls,
isSlot: true,
flex: 1,
listeners: {
itemtap: this.onItemTap,
scope: this
scroll: {
direction: 'vertical',
scrollbars: false,
snapping: true,
deceleration: 0.006,
friction: 0.2,
index: i,
listeners: {
scrollend: this.onScrollEnd,
scope: this
tpl: '<ul class="x-picker-{align}"><tpl for="."><li class="x-picker-item {cls} <tpl if="extra">x-picker-invalid</tpl>">{' + this.displayField + '}</li></tpl></ul>',
store: new Ext.data.Store({
model: this.model,
data: slot.items
if (this.useTitles) {
slotItem.dockedItems = [{
xtype: 'toolbar',
dock: 'top',
title: slot.title || slot.text
// alert(items.push(slotItem));
The above code is used to configure the spinner.Now I have created a image buttons Shake and lock as shown in the image. spin.jpg
My requirement is:
1. When I click on Shake image the Spinner will dynamically scroll and select some random values. The spinner is configured in the above for loop so I try to call that function in the onclick event of Shake button and tried to control the spinner. But I failed to control the Scroll the Spinner.
2. In the same when I click on Lock image its relevant Spinner has to be locked and unlocked.

I tried in different ways but I Strucked to find a solution to those 2 functionalites. Please help me its urgent.
for reference please visit http://www.urbanspoon.com/spin-widget

Thanks in Advance......