PDA

View Full Version : Picker and option select



gabrielstuff
28 Sep 2010, 9:46 PM
Hi !
Is there a way to go back to the native picker ? First the native picker was working well. And second, the js one is less functional. There is no next and prev button and it feels not well.

Any way, why do you choose to reinvent things that are working ? is it just for android ??

Thank you !

Gabriel

gabrielstuff
3 Oct 2010, 3:45 PM
Well picker is nice but, I think that you forgot to think about languages. The Done button is always in one language (english).
More other it is cool that the picker fix the list issues but what about the keyboard ???
It is not disappearing when you click out and it is very anoying to see it even on an other tabs 0_o.

Here is the code that might help :





Ext.regModel('school', {
fields: [
{name: 'shcool', type: 'string'}
]
});

Ext.regModel('town', {
fields: [
{name: 'town', type: 'string'}
]
});


Ext.ux.alertForm = Ext.extend(Ext.form.FormPanel, {
scroll: 'vertical',
standardSubmit : false,
style:'padding:0px 8px;',
frame: true,
id:'alertform',
flex: 1,

initComponent: function() {

this.t_storeEcole = new Ext.data.Store({
autoLoad: true,
model: 'ecole',
proxy: {
url: app.streamschool,
type: 'scripttag',
reader: {
root: 'data'
}
}
});

this.t_storeVille = new Ext.data.Store({
autoLoad: true,
model: 'town',
proxy: {
url: pwc.fluxouttown,
type: 'scripttag',
reader: {
root: 'data'
}
}
});

this.submitButton = new Ext.Button({
cls: 'bluebtn',
style:'font-size:1em',
text: 'Je m\'inscris',
scope: this,
handler: function(){
this.submit({
url: pwc.regmobile,
method: 'POST',
reset: false,
failure: function(result, action)
{
obj = Ext.util.JSON.decode(action.response.responseText);
var message = obj.errors.reason;
},
success: function(result, action)
{
alert('Votre inscription a bien été enregistrée');
pwc.Main.onBackButtonTap();
obj = Ext.util.JSON.decode(action.response.responseText);
}}); //fin du submit
}
});

this.items = [{
html: '<div class="spacer"></div>'
},{
style:'font-size:1.3em',
html: '<p>FOO</p>'
},{
html: '<div class="spacer"></div>'
},{
xtype: 'fieldset',
title: 'Nom',
items: [{
xtype: 'textfield',
name: 'name'
}]
},{
xtype: 'fieldset',
title: 'Prénom',
items: [{
xtype: 'textfield',
name: 'fname'
}]
},{
xtype: 'fieldset',
title: 'Email',
items: [{
xtype: 'emailfield',
name: 'email'
}]
},{
xtype:'fieldset',
title:'Votre école :',
items:[
{xtype: 'select',
name : 'townname',
emptyText: 'No city in the list',
valueField : 'town',
displayField : 'town',
store : this.t_storeVille}]
},{
xtype: 'fieldset',
title: 'Autre',
items: [{
xtype: 'textfield',
name: 'othertown'
}]
},
{
xtype:'fieldset',
title:'Votre école :',
items:[
{xtype: 'select',
name : 'schoolname',
emptyText: 'No school in the list',
valueField : 'schoolname',
displayField : 'schoolname',
store : this.t_storeEcole}]
},{
xtype: 'fieldset',
title: 'Autre',
items: [{
xtype: 'textfield',
name: 'other'
}]
},{
html: '<div class="spacer"></div>'
},{
html: '<div class="spacer"></div>'
},
this.submitButton,
{
html: '<div class="spacer"></div>'
},{
html: '<div class="spacer"></div>'
}];

this.listeners = {
submit: function(form, result){
console.log('success', Ext.toArray(arguments));
},
exception: function(form, result){
console.log('failure', Ext.toArray(arguments));
},
keyup: function(fld, e){
if (e.browserEvent.keyCode == 13) {
e.stopEvent();
fld.fieldEl.dom.blur()
}
}

};
this.addListener("beforeactivate",this.onDisplayWin);

Ext.ux.alertForm.superclass.initComponent.call(this);

}


Thank you !