[CLOSED] Grid ListFilter

  1. #1

    [CLOSED] Grid ListFilter

    Trying to set a value for a list filter but seems I'm doing something wrong (works for StringList).

       protected void SetFilterOpen(object sender, DirectEventArgs e)
        {
            ListFilter sf = (ListFilter)GridFilters1.Filters[0];
            sf.SetValue(new string[] {"Open"});
            sf.SetActive(true);
        }

    The script generated is:

    ({script:"App.GridFilters1.getFilterPlugin().getFilter(\"actStatus\").setValue([\"Open\"]);App.GridFilters1.getFilter(\"actStatus\").setActive(true);"})
    Seems getFilterPlugin() is undefined.

    List definition:

     <ext:GridFilters ID="GridFilters1" runat="server" Local="false"  >
       <Filters>
         <ext:ListFilter DataIndex="actStatus" Options="Open,Closed" />
    Thanks!
    Last edited by Daniil; Sep 12, 2012 at 5:33 AM. Reason: [CLOSED]
  2. #2
    Thank you for the report. Fixed in SVN, please update and retest
  3. #3
    Hi @watteeuw,

    Welcome to Ext.NET!

    Just some addition to the @Vladimir's post.

    The fix has been added to SVN, revision #4338, the 2.1 branch:
    http://svn.ext.net/premium/branches/2.1/

    Also the fix will be included in the next official release (no date yet).

    We are marking the thread closed. Though, please feel free to post if you have anything to add or ask, related to the topic.

    Thanks again for the report!
  4. #4
    Didn't checked if it works, but in the meantime
    one more question:

    A configuration as below:
    <ext:GridFilters ID="GridFilters1" runat="server" Local="false" >
     <Filters>
    <ext:ListFilter DataIndex="actStatus" Options="Open,Closed" Value="Open" Active="true"/>
    doesn't mean to be applied automatically at loading time the filter ?

    Because is only checked the checkbox in the menu but the filter is not applied until a new filter is selected.

    Quote Originally Posted by Daniil View Post
    Hi @watteeuw,

    Welcome to Ext.NET!

    Just some addition to the @Vladimir's post.

    The fix has been added to SVN, revision #4338, the 2.1 branch:
    http://svn.ext.net/premium/branches/2.1/

    Also the fix will be included in the next official release (no date yet).

    We are marking the thread closed. Though, please feel free to post if you have anything to add or ask, related to the topic.

    Thanks again for the report!
  5. #5
    Agreed, I think it should be applied. We will investigate.

    Thanks again for the report!
  6. #6
    Unfortunatelly, it isn't fully working.

    But "the good news" is it is working after a header filter is selected manually.
    Check your example:
    /GridPanel/Plugins/GridFilters_Local/Default.aspx

    Press button "Find 3...." after page loading and you'll get an error
    But if you select from header menu a filter and then, you press again the button, it works.

    Quote Originally Posted by Vladimir View Post
    Thank you for the report. Fixed in SVN, please update and retest
  7. #7
    Quote Originally Posted by cata View Post
    Unfortunatelly, it isn't fully working.

    But "the good news" is it is working after a header filter is selected manually.
    Check your example:
    /GridPanel/Plugins/GridFilters_Local/Default.aspx

    Press button "Find 3...." after page loading and you'll get an error
    But if you select from header menu a filter and then, you press again the button, it works.
    Hi @cata,

    Thank you for the report! We will investigate.
  8. #8
    It has been fixed in revision #4343, please update or apply this fix:

    Fix
    <script type="text/javascript">
        Ext.ux.grid.FiltersFeature.override({
            ensureFilters : function () {
                if (this.view && this.view.headerCt && !this.view.headerCt.menu) {
                    this.view.headerCt.getMenu();
                }
            },
            onBeforeLoad : function (store, options) {
                if(!options){
                    return;
                }
                this.ensureFilters();
                options.params = options.params || {};
                this.cleanParams(options.params);
                var params = this.buildQuery(this.getFilterData());
                Ext.apply(options.params, params);
            },
            getFilter : function (dataIndex) {
                this.ensureFilters();        
                return this.filters.get(dataIndex);
            }
        });
    </script>
    Thank you again for the reports!
  9. #9
    Now is perfect! Thanks!

    Quote Originally Posted by Daniil View Post
    It has been fixed in revision #4343, please update or apply this fix:

    Fix
    <script type="text/javascript">
        Ext.ux.grid.FiltersFeature.override({
            ensureFilters : function () {
                if (this.view && this.view.headerCt && !this.view.headerCt.menu) {
                    this.view.headerCt.getMenu();
                }
            },
            onBeforeLoad : function (store, options) {
                if(!options){
                    return;
                }
                this.ensureFilters();
                options.params = options.params || {};
                this.cleanParams(options.params);
                var params = this.buildQuery(this.getFilterData());
                Ext.apply(options.params, params);
            },
            getFilter : function (dataIndex) {
                this.ensureFilters();        
                return this.filters.get(dataIndex);
            }
        });
    </script>
    Thank you again for the reports!
  10. #10
    Quote Originally Posted by cata View Post
    Now is perfect! Thanks!
    Thank you for confirmation, @cata!

Similar Threads

  1. Replies: 5
    Last Post: Sep 03, 2012, 1:38 PM
  2. [CLOSED] Hidden Change and Grid Filters are not working after Grid Reconfigure
    By speedstepmem3 in forum 1.x Legacy Premium Help
    Replies: 15
    Last Post: Oct 16, 2011, 1:12 PM
  3. Replies: 16
    Last Post: Feb 23, 2011, 10:03 AM
  4. Replies: 1
    Last Post: Oct 09, 2009, 3:46 AM
  5. Replies: 1
    Last Post: Sep 11, 2009, 11:41 AM

Posting Permissions