Results 1 to 3 of 3

Thread: Ext 4.2 Grid filter on one column with multiple values

  1. #1

    Default Answered: Ext 4.2 Grid filter on one column with multiple values

    Hi Guys,

    I am new to ExtJS. I am trying to filter out data which is rendered to grid.
    what i need is that, there is a column called "Status" which can have"CLOSED" or "OPEN" or "N/A" status for a row.

    I have a checkbox which says "Show Closed Status" outside the grid which is on top of the page. By default it should be unchecked and the the grid should be filtered by "OPEN" and "N/A" status rows and when I Check this field it should show all status i.e. "CLOSED", "OPEN" and "N/A" rows.

    Please help me with this issue that i am facing with.

    Thanks in advance.

    Looking forward to hear from you guys.

  2. You would need to setup a renderer for the column to where the value is checked and the value returned is the string you want.
    http://docs.sencha.com/extjs/4.2.4/#...n-cfg-renderer

    There is also the option to have a convert field to alter your data:
    http://docs.sencha.com/extjs/4.2.4/#...ld-cfg-convert

    Yet another option is to return the string from the per a sql join is that is an option.

    Scott.

  3. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,410
    Answers
    716

    Default

    You would need to setup a renderer for the column to where the value is checked and the value returned is the string you want.
    http://docs.sencha.com/extjs/4.2.4/#...n-cfg-renderer

    There is also the option to have a convert field to alter your data:
    http://docs.sencha.com/extjs/4.2.4/#...ld-cfg-convert

    Yet another option is to return the string from the per a sql join is that is an option.

    Scott.

  4. #3

    Default

    Thank you very much Scott.

    With the solution you gave I found an alternate solution for this.
    based on the value of the check box field I will filter using below code,

    Code:
    grid.store.filterBy(function(rec) {
                                        var value = rec.get('status');
                                        return (value != 'CLOSED');
                                    },this);
    This filters out all the values except "CLOSED" status.

Similar Threads

  1. FIlter multiple values in store.
    By jesus.valencia in forum Ext: Q&A
    Replies: 1
    Last Post: 11 Mar 2015, 10:00 PM
  2. Filter grid with multiple values
    By olaeke in forum Ext 5: Q&A
    Replies: 3
    Last Post: 4 Dec 2014, 11:41 PM
  3. How to do grid store filter by multiple values
    By santhu227 in forum Ext 3.x: Help & Discussion
    Replies: 1
    Last Post: 1 Oct 2012, 3:37 AM
  4. Replies: 1
    Last Post: 29 Sep 2011, 10:32 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
  •