Question

In Sencha Touch 2, there is

{
      id:'mydatepicker',
      xtype: 'datepickerfield',
      //some more details are here
}

It works fine. All I want is to display this datepickerfield not just by tapping on the datepickerfield (which is OK), but by tapping on the button on another part of the screen as well.

So, what string should be in the controller to show the datepickerfield by its id?

Was it helpful?

Solution 2

1: Add a reference for the button you want to tap and one for the datepicker.

2: Add a control to listen for the tap event on your button.

3: Create a handler for the tap event that calls show on the datepicker reference.

Here is a link for the controller API which has a great description of how to setup refs and controls.

If you are not able to get to the solution from that feel free to post some code and I can try to help you with a more specific answer.

Good luck, Brad

OTHER TIPS

More simple: http://docs.sencha.com/touch/2.2.1/#!/api/Ext.picker.Date

Example:

var datePicker = Ext.create('Ext.picker.Date', {
    yearFrom: 2000,
    yearTo  : 2015,
    value: new Date(),
    useTitles: false
});
Ext.Viewport.add(datePicker);
datePicker.show();
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top