PDA

View Full Version : Scroll the Spinner on button click



pavithra
28 Aug 2010, 3:04 AM
Hi friends i am new to Sencha related application development. Currently I am working on spinner application. My requirement is when the user clicks on Shake button shown in the image below. The values in the spinner has to scroll dynamically and select some random values. 22167

I tried in different ways to scroll the values in the spinner whiile clicking on Shake button but I cannot find a solution to it can you please help me out in it.

Thanks in advance.......

Animal
28 Aug 2010, 5:00 AM
Shouldn't this be in the Sencha Touch "Help" folder?

pavithra
31 Aug 2010, 9:58 PM
Hi friends,
To make the requirement little bit simple and clear please check this link http://www.urbanspoon.com/spin-widget contain application related to my requirement.

pavithra
18 Sep 2010, 12:11 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));
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. 22474
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.

Thanks in Advance......

priya gupta
16 Dec 2011, 4:15 AM
hi,
I want a code for the above shown view.I need it in my project and i am unable to find it
Please help me