PDA

View Full Version : Slider orientation change ...



Riddler
29 Nov 2010, 3:44 AM
Hi to all,
I have a slider min 0.5 max 11 (value)
When the orientation chage I found e bug ... maybe my error ..

I the iPhone is orizontal and the Knod in the position 11 (to the right) if I change in vertical position the kinob appear outside the panel ...

If I position the knob in 11 (value) on the vertical orinatatione when change on the orizontal the knob position in in the middle ... this is my code:



function main(){

var slider = new Ext.form.Slider({
xtype: 'slider',
name: 'distance',
label: '<div class="label">Raggio Km:</div> <div id="viewDistance">0.5</div>',
minValue: 0.5,
maxValue: 11,
increment: 0.25,
listeners: {
'change': function(slider, thumb, value){
callWS(lat,lon,slider.getValue());
Ext.get('viewDistance').update(value);
//alert('CALL WS!!!\nlat= ' + lat +'\nlon= ' + lon);
},
'drag': function(slider, thumb, value){
Ext.get('viewDistance').update(value);
}
},
style: {
paddingBottom: '15px',
zIndex: '999'
}
});

//getGeoPosition();

panel = new Ext.Panel({
fullscreen: true,
scroll: 'vertical',
dockedItems: [
{
dock : 'top',
xtype: 'toolbar',
title: '<span id="#title">Ristoranti</span>'
},
{
dock : 'bottom',
xtype: 'panel',
items: [
slider
],
style: {
borderTop: 'solid 1px #C3C3C3',
width: '100%'
}
},
],

html: ''
});
// ORIENTATION
Ext.EventManager.onWindowResize(setActivePanel);
Ext.EventManager.onOrientationChange(setActivePanel);

function setActivePanel(){
panel.setOrientation( Ext.getOrientation() , window.innerWidth , window.innerHeight );
panel.doLayout();
slider.refresh(); //setValue(Ext.get('viewDistance').value);
};



I can intercept the orientation change ... but not redefy e position's knob ...

--
Riddler ?

Riddler
17 Dec 2010, 2:49 AM
I have not resolve this problem :(

Anyone have some ideas?