Results 1 to 6 of 6

Thread: Is there any to add a listener to the filter date property

  1. #1

    Default Is there any to add a listener to the filter date property

    I have a date filter that I want to add a listener to, something like:
    Code:
     
    fields: [{
                  filter: {                
                            xtype: 'superdate-search-field',
                            fieldLabel: 'Date',
                             listeners: {
                                change: function(event) {
                              //stuff here
                                },
                                scope: this
                            }
                        }
    }]
    the above code is not working for me. Is there a way I can add a listener function to do stuff after the date filed is instantiated?
    Thanks

  2. #2
    Sencha User jdkhamba's Avatar
    Join Date
    Jul 2012
    Posts
    236
    Answers
    45

    Default

    Aer you talking about grid column filters? If so, these are the only events available:

    http://docs.sencha.com/extjs/4.2.0/#...-cfg-listeners

    I am not sure why you would need to have a listener on the filter though.

  3. #3

    Default

    Well this filter is more of a dropdown search field.something like attached.
    I basically want to do stuff when a search filter is instantiated, like hide few dropdown options.
    It instantiates where I have my listeners mentioned. Not sure if the one listed in the comment would be helpful...js:

    Code:
    $cls.superclass.constructor.call(this, Ext.apply({                
                   directFn: this.getData,
                    fields:[{
                       name: 'date',
                        type: 'date',
                        filter: {
                            type: 'string',
                            xtype: 'superdate-search-field',
                            fieldLabel: 'Event Date'
                             listeners: {
                                selectionchange: function(sm) {
                                    debugger;
                                },
                                scope: this
                            }
                        }
    }] [{
    Attached Images Attached Images

  4. #4
    Sencha User jdkhamba's Avatar
    Join Date
    Jul 2012
    Posts
    236
    Answers
    45

    Default

    Code:
    xtype: 'superdate-search-field'
    What is this exactly? Which ExtJS component does it extend from ?

  5. #5

    Default

    Code:
    Ext.form.TwinTriggerField
    Code:
    Ext.extend($cls, Ext.form.TwinTriggerField, {        
    
          initComponent : function() {
            }
    
                });

  6. #6
    Sencha User jdkhamba's Avatar
    Join Date
    Jul 2012
    Posts
    236
    Answers
    45

    Default

    This is never going to work. There are just too many things that are wrong. Take a look at the docs:

    http://docs.sencha.com/extjs/4.2.0/#....field.Trigger

    There is no such thing as "directFn" or "fields" or any of that in the configs. Moreover,
    this syntax:

    Code:
    $cls.superclass.constructor.call(this, Ext.apply({
    Was more prevalent in Ext 3.x , there is no need to code like that if you are using Ext 4.x,also since there are no configs called "fields", none of it is actually getting applied to $cls.

    Code:
     listeners: {
                                selectionchange: function(sm) {
                                    debugger;
                                },
                                scope: this
                            }
    There is no selectionchange event, although there is a change event. But none of that is going to get applies as the configs are all wrong and not getting applied.

Similar Threads

  1. Replies: 7
    Last Post: 3 Jun 2015, 4:24 AM
  2. Replies: 3
    Last Post: 3 Feb 2015, 6:53 AM
  3. Replies: 18
    Last Post: 24 Sep 2014, 12:00 PM
  4. Replies: 1
    Last Post: 27 Jun 2012, 4:00 PM
  5. Replies: 3
    Last Post: 5 Oct 2009, 7:28 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •