Results 1 to 3 of 3

Thread: Date grid filter override problem

  1. #1
    Sencha Premium Member
    Join Date
    Feb 2016
    Location
    Hungary
    Posts
    12
    Answers
    1

    Default Answered: Date grid filter override problem

    Hi!

    I have a problem overriding the Ext.grid.filters.filter.Date class. I apply the next override, but it doesn't work

    Code:
    Ext.define('Ext.locale.hu.grid.filters.filter.Date', {
        override: 'Ext.grid.filters.filter.Date',
        fields: {
            lt: {text: 'El?tte'},
            gt: {text: 'Utna'},
            eq: {text: 'Pontosan'}
        },
        dateFormat: 'Y-m-d',
        pickerDefaults: {
            startDay: 1
        }
    });
    It is really strange, because in the same file I have an override on Ext.grid.filters.filter.String (emptyText property) and it works perfectly. Do you have any suggestion?

    ExtJS version: 6.0.1.250

  2. You need to wrap some of the configs in config (mainly fields) . Take a look at the source code and try to follow the same structure when overriding classes.

  3. #2
    Sencha User
    Join Date
    Jan 2016
    Posts
    462
    Answers
    60

    Default

    You need to wrap some of the configs in config (mainly fields) . Take a look at the source code and try to follow the same structure when overriding classes.

  4. #3
    Sencha Premium Member
    Join Date
    Feb 2016
    Location
    Hungary
    Posts
    12
    Answers
    1

    Default

    Thanks for the answer, now it's working in this way

    Code:
    Ext.define('Ext.locale.hu.grid.filters.filter.Date', {
        override: 'Ext.grid.filters.filter.Date',
        config: {
            fields: {
                lt: { text: 'El?tte' },
                gt: { text: 'Utna' },
                eq: { text: 'Pontosan' }
            },
            dateFormat: 'Y-m-d'
        }
    });
    Someone also suggested to me, that I have to override the getFields method, that works too.
    But I think your suggestion is better, because I do not want to override built in methods.

Similar Threads

  1. Replies: 3
    Last Post: 17 Nov 2016, 9:52 PM
  2. Replies: 18
    Last Post: 24 Sep 2014, 12:00 PM
  3. Extjs 4.1.1GPL - Date Filter Problem
    By renganathan in forum Ext: Q&A
    Replies: 1
    Last Post: 3 Oct 2012, 7:35 AM
  4. Replies: 1
    Last Post: 27 Jun 2012, 4:00 PM
  5. Ext.PagingToolbar with Filter Window using Ext.ux.grid.RowEditor (override)
    By jorgelive in forum Ext 3.x: User Extensions and Plugins
    Replies: 1
    Last Post: 16 Nov 2010, 4:58 AM

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
  •