1. #1
    Sencha User
    Join Date
    Feb 2012
    Posts
    219
    Vote Rating
    5
    Answers
    10
    webfriend13 is on a distinguished road

      0  

    Default Answered: Click event for DatePicker is only working for calender icon but not for textbox

    Answered: Click event for DatePicker is only working for calender icon but not for textbox


    Hi All,

    I used following code to add a datefield. Datefield comes with a text box and a calender icon by default.
    Below Code is adding 'click' event on top of calender icon (shown in the red cricle) but not over the text box (shown in yellow background).

    Picker.PNG

    Code:
    Ext.define('MyDate', {
        extend: 'Ext.form.field.Date',
        
        onTriggerClick: function(){
            Ext.create('Ext.window.Window', {
                title: 'I am a window',
                width: 200,
                height: 200,
                autoShow: true
            });
        }
    });
    Ext.onReady(function(){
        new MyDate({
            renderTo: document.body
        });
    });

  2. Try to set editable config of your datefield to false.

  3. #2
    Sencha User
    Join Date
    Sep 2011
    Posts
    573
    Vote Rating
    73
    Answers
    58
    ettavolt is just really nice ettavolt is just really nice ettavolt is just really nice ettavolt is just really nice

      1  

    Default


    Try to override 'expand' method (inherited from Picker).
    Also, by default, field is editable, that's why clicking on input will only bring focus to it.

  4. #3
    Sencha - Community Support Team
    Join Date
    Jan 2012
    Posts
    1,376
    Vote Rating
    115
    Answers
    346
    vietits is a splendid one to behold vietits is a splendid one to behold vietits is a splendid one to behold vietits is a splendid one to behold vietits is a splendid one to behold vietits is a splendid one to behold

      0  

    Default


    Try to set editable config of your datefield to false.

Thread Participants: 2