Forum /
Sencha Touch 2.x Forums /
Sencha Touch 2.x: Q&A /
Unanswered: Ext.picker.Date getValue() Null
Unanswered: Ext.picker.Date getValue() Null
Hy I am using the plugin Slider-Menu with navigation view
I have this view:
Ext.define('UnivMobile.view.AddEvent', {
extend: 'Ext.Panel',
requires: ['Ext.picker.Date'],
xtype: 'option2card',
config:{
title: 'Add Event'
},
config: {
fullscreen: true,
title: 'Add Event',
name:'p',
items: [ {
xtype: 'fieldset',
items: [
{
xtype: 'textfield',
name: 'nomEvent',
id:'nomevent',
label: 'Nom Event:'
},
{
xtype: 'textfield',
name: 'dateDebEvent',
id:'debEvent',
label: 'Date de debut Event:',
value:new Date,
listeners : {
focus:function( ) {
var datePicker= Ext.create(Ext.picker.Date, {
dateFormat:'Y-m-d',
id:'picker1',
doneButton:{
listeners:{
tap:function (button, event, eOpts) {
console.log('inside done button'); //It works
console.log(Ext.getCmp('picker1').getValue());// It doesn't work (null)
console.log('done button');// It works
}
}
}
});
this.parent.parent.parent.parent.push(datePicker);
}
}
},
{
xtype: 'textfield',
name: 'dateFinEvent',
id:'finEvent',
label: 'Date de fin Event:'
},
{
xtype: 'textfield',
name: 'lieu',
id:'loc',
label: 'Lieu:',
}
] // items
},
{
xtype: 'toolbar',
layout: {
pack: 'center'
}, // layout
ui: 'plain',
items: [
{
xtype: 'button',
text: 'Reset',
id:'resetb',
ui: 'decline',
listeners: {
tap: function(){
this.parent.parent.parent.parent.push(Ext.Msg.confirm('', 'Are you sure you want to reset this form?', function (btn) {
switch (btn) {
case 'yes':
var valueNom=Ext.getCmp('nomevent');
valueNom.setValue('');
break;
default:
break;
} // switch
})
);
}
}
},
{xtype: 'button',
text: 'Submit',
ui: 'confirm',
listeners: {
tap: function(){
this.parent.parent.parent.parent.push(Ext.Msg.alert('rr'));
}
}
}
] // items (toolbar)
}
]
}
});
I got the datePicker but when I click on done button.The value of datePicker is null
Please any help???
Sencha is used by over two million developers. Join the community, wherever you’d like that community to be
or Join Us