Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Ext JS Premium Member
    Join Date
    Nov 2010
    Posts
    78
    Vote Rating
    2
    watermark is on a distinguished road

      0  

    Default Ext.ux.grid.filter.DateFilter setValue doesn't really set value

    Ext.ux.grid.filter.DateFilter setValue doesn't really set value


    Ext version tested:
    • Ext 4.1.3
    Browser versions tested against:
    • Chrome
    Description:
    • The setValue function only sets the check status and the picker value, not the actual field value. The field value only gets updated on check change, hence, setValue doesn't really set the value until the filter is unchecked and rechecked.
    Steps to reproduce the problem:
    • Create a grid with a date column, create a datefilter on that column
    • Set the filter normally via the column menu
    • Set the filter value pragmatically via code below
    • Call getValue on the filter
    The result that was expected:
    • The setValue call changes the value that getValue returns
    The result that occurs instead:
    • getValue still returns what was previously set, as if setValue wasn't called
    Test Case:
    Code:
    var filter = grid.filters.get('datecolumn');
    var oldDate = filter.getValue();
    var newDate = { after: new Date('[somedate]') };
    filter.setValue(newDate);
    var setDate = filter.getValue();
    
    newDate != setDate
    
    newDate == oldDate

  2. #2
    Ext JS Premium Member
    Join Date
    Nov 2010
    Posts
    78
    Vote Rating
    2
    watermark is on a distinguished road

      1  

    Default


    workaround:

    Code:
    Ext.ux.grid.filter.DateFilter.override({
    	init: function() {
    		this.callOverridden();
    		this.on('update', this.updateValues);
    	},
    
    
    	updateValues: function() {
    		var me = this, key, picker;
    		for (key in me.fields) {
    			if (me.fields[key].checked) {
    				picker = me.getPicker(key);
    				me.values[key] = picker.getValue();
    			}
    		}
    	}
    });

  3. #3
    Sencha User
    Join Date
    Nov 2013
    Posts
    6
    Vote Rating
    0
    geovanni.duarte is on a distinguished road

      0  

    Default this.fields[item].menu is null help

    this.fields[item].menu is null help


    Good afternoon, I'm creating a dynamic grid panel and works fine, except the DateFilters, when i want to filter at second time, show on console the following error : this.fields[item].menu is null, debugging the javascritp code i found that the menu object in the CheckItem is null after the first filter . I need help, took three days solving this error. thanks. i´m using sencha 4.1.0.

Thread Participants: 1