Results 1 to 2 of 2

Thread: Grid Date Filter Set Value

  1. #1
    Sencha Premium User
    Join Date
    Dec 2010
    Posts
    291

    Default Grid Date Filter Set Value

    On a grid date filter how would you select a date before render? I can get a reference to the filter with

    Code:
    onGridBeforeRender: function(component, eOpts) {
        var filter = component.down('#dateCreated').filter;
        
    }
    After that how would I select a date in the Before field?

  2. #2
    Sencha Premium User
    Join Date
    Dec 2010
    Posts
    291

    Default

    In case anyone else needs to know how to do this...

    On = eq
    Before = lt
    After = gt

    In view controller:
    Code:
    onGridBeforeRender: function(component, eOpts) {
      var filter = component.down('#effectiveDate').filter;
      filter.setValue({eq: new Date()});
    }

    In view:

    Code:
    filter: {
        type: 'date',
        value: {
            eq: new Date()
        }
    }

    You could also set more than one option:

    Code:
    filter.setValue({eq: new Date(), lt: new Date(2016, 9, 27)});

Posting Permissions

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