We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Filter from outside the grid

Say I had a search bar above the grid that I wanted to use to filter. 
I enabled excel style filtering.
I have the grid object using viewchild.
I'm not sure how to pick a column and manually filter it. I essentially just want it to be as if they typed the query into the excel filter itself

6 Replies

ZA Zack January 24, 2017 10:18 PM UTC

Took advantage of this.grid.widget.filterColumn to achieve the desired result from looking at another support post. Thanks!


PK Prasanna Kumar Viswanathan Syncfusion Team January 25, 2017 06:46 AM UTC

Hi Zack, 

Thanks for contacting Syncfusion support. 

We are happy to hear that your issue has been resolved. 

Please let us know if you need any further assistance.  

Regards, 
Prasanna Kumar N.S.V 



BS Bernd Schuhmacher February 16, 2017 02:16 PM UTC

Hi

I think I am stuck with something that sounds like the given problem.

I created a page with some dropdowns (HTML select) and an ejGrid.
My goal is to select an entry from one of the dropdowns and filter the data given in the ejGrid with a given column and the selected value.

I imported core.js (import { EJComponents } from 'ej-angular2/src/ej/core) and created a ViewChild (@ViewChild('KranTabelle') Grid: EJComponents<any, any>;).

After that it seems I can access the grid with
this.Grid.widget

But I do not know what to do after that. Is it possible what I want?
Is there some more documentetion somewhere?

Regards
Bernd



PK Prasanna Kumar Viswanathan Syncfusion Team February 17, 2017 02:08 PM UTC

Hi Bernd, 

      Queries 
                                           Response 

I created a page with some dropdowns (HTML select) and an ejGrid.
My goal is to select an entry from one of the dropdowns and filter the data given in the ejGrid with a given column and the selected value.
” 


We have created a sample with a dropdown and an ejGrid. For the dropdown we bind the change event.  

In change event of dropdown we can get the change value in the arguments and in this we get the grid instance and filter the grid using filterColumn method of ejGrid. 

Find the code example and sample:  

<select id="EmployeeID" name="EmployeeID" (change)="dropdown($event.target.value)"> 
      <option value="1">1</option> 
      <option value="2">2</option> 
      <option value="3">3</option> 
    </select> 
        
     
<ej-grid [allowPaging]="true" id="Grid" [allowSorting]="true" [dataSource]="gridData" [columns]="columns" [allowFiltering]="true"  [toolbarSettings]= "tool"> 
<e-columns> 
        ----------------------------------- 
   </e-columns> 
</ej-grid> 
 
------------------------------------ 

xport class AppComponent { 
    
    public editTemp; 
    dropdown(event) { 
        var obj = $('#Grid').data("ejGrid"); 
        obj.filterColumn("EmployeeID", "equal", parseInt(event), "and", true); 
    } 
    public tool = { showToolbar: true, toolbarItems: ["add", "edit", "delete", "update", "cancel"] } 
    ------------------------------ 
} 


Refer to the Help document for the filterColumn method 



I imported core.js (import { EJComponents } from 'ej-angular2/src/ej/core) and created a ViewChild (@ViewChild('KranTabelle') Grid: EJComponents<any, any>;).” 


Yes, we have a documentation for this and please download the document from the following link 


We have already created a Knowledgebase documentation for this and it will be published sooner.   


Regards, 
Prasanna Kumar N.S.V 
 



BS Bernd Schuhmacher February 20, 2017 07:07 AM UTC

Hi

Thanks for those hints. This helped a lot.

Regards
Bernd


PK Prasanna Kumar Viswanathan Syncfusion Team February 21, 2017 03:58 AM UTC

Hi Bernd, 

We are happy to hear that your issue has been resolved. 

Please let us know if you need any further assistance. 

Regards, 
Prasanna Kumar N.S.V 


Loader.
Up arrow icon