[CLOSED] Filterheader and getRowsValues

  1. #1

    [CLOSED] Filterheader and getRowsValues

    Hi,

    I have a grid panel that uses the FilterHeader plugin to allow filtering in the header.
    When the user clicks on the Save button, I want to save the contents of this grid to the database. However the filters are creating a problem.
    And this is how:

    If the user has entered a text in one of the header filters, and the grid shows only filtered rows then even if I clear the filters before saving (using a Direct Method) getRowsValues() gives me the filtered records. I don't just want the filtered records, I want all records.
    Please delete/close - I have already solved this issue. Thanks


    I try to clear the filters in the Before event handler and I see it get cleared on the UI but when it calls the Controller, I only see the filtered records.

    There should be an ignoreFilters config on getRowsValues().

    Do you know of a way to get around this?

    My Direct Events code

    .DirectEvents(de =>
                    {                    
                        de.Click.EventMask.ShowMask = true;
                        de.Click.EventMask.Msg = "Saving Changes...";
                        de.Click.Url = Url.Action("SaveUser", "Admin");
                        de.Click.CleanRequest = true;
                        de.Click.Method = HttpMethod.POST;
                        de.Click.Before = "return SPARTA.UserAdmin.clearFilters()";                          
                        de.Click.ExtraParams.Add(new Parameter("selUser", "SPARTA.UserAdmin.makeUserObject('" + userId + "', #{txtUAFirstName}.getRawValue(), #{txtUALastName}.getRawValue(), #{dpdUAAllCountries}.getValue(), #{chkUAActive}.getValue())", ParameterMode.Raw));
                        de.Click.ExtraParams.Add(new Parameter("selPermissions", "Ext.isDefined(Ext.getCmp('gpPermSelected')) ? Ext.encode(App.gpPermSelected.getRowsValues({selectedOnly : false, visibleOnly : false})) : '' ", ParameterMode.Raw));
                        de.Click.ExtraParams.Add(new Parameter("selCountries", "Ext.isDefined(Ext.getCmp('gpCountrySelected')) ? Ext.encode(App.gpCountrySelected.getRowsValues({selectedOnly : false, filterField : function (record, fieldName, value) { return fieldName == \"Id\"; }})) : '' ", ParameterMode.Raw));                    
                        de.Click.Failure = "SPARTA.Utils.showError('Oops', 'Sorry, we are unable to Save your changes because of an error.<p/>Error Details:<br/>' + result.errorMessage );";
                        de.Click.Success = "SPARTA.Utils.showSuccess('User changes were updated successfully!'); this.up('panel').up('window').close();";
                    }
                )
    My JS Code for Clearing the filter

    clearFilters: function () {
    
                var pgrid = Ext.getCmp('gpPermSelected'),
                    cgrid = Ext.getCmp('gpCountrySelected');
    
                if (Ext.isDefined(pgrid)) {
                    var pstore = pgrid.getStore();
                    pgrid.filterHeader.clearFilter();                               
                }                        
    
                return true;
            },
    Last edited by Daniil; May 26, 2014 at 5:53 AM. Reason: [CLOSED]
  2. #2
    Hi @leonardm,

    Quote Originally Posted by leonardm View Post
    Please delete/close - I have already solved this issue. Thanks
    Sharing a solution might help other forum members in the future.

Similar Threads

  1. GridPanel : FilterHeader Bug
    By brunweb in forum 2.x Help
    Replies: 7
    Last Post: Apr 01, 2014, 3:08 AM
  2. hidden FilterHeader
    By maxdiable in forum 2.x Help
    Replies: 1
    Last Post: Dec 24, 2013, 1:49 AM
  3. Hide/Show FilterHeader Plugin
    By ADV in forum 2.x Help
    Replies: 2
    Last Post: Dec 24, 2013, 1:46 AM
  4. [CLOSED] FilterHeader Plugin Error
    By leonardm in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Aug 21, 2013, 4:53 PM
  5. [OPEN] [#308] FilterHeader and infinite scrolling
    By HansWapenaar in forum 2.x Legacy Premium Help
    Replies: 16
    Last Post: Aug 05, 2013, 9:56 AM

Tags for this Thread

Posting Permissions