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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Grid: what is the method getQuery() for?

Thread ID:

Created:

Updated:

Platform:

Replies:

147454 Sep 11,2019 09:26 AM UTC Sep 12,2019 10:58 AM UTC Angular - EJ 2 1
loading
Tags: Grid
Viktor
Asked On September 11, 2019 09:26 AM UTC

Hi,
is this method (Grid.getQuery()) not supposed to get current query from the grid?
it doesnt seem to be working (see picture below).
and this leads me to ask the question of it is somehow possible to get the current query (where\sort) from the grid?
thanks for your support in advance
regards
viktor



Thavasianand Sankaranarayanan [Syncfusion]
Replied On September 12, 2019 10:58 AM UTC

Hi Viktor, 
 
Greetings from Syncfusion. 
 
Query: is this method (Grid.getQuery()) not supposed to get current query from the grid? 
 
We have validated your query and by default we have Query property in our grid. It is used to pass some additional parameters to grid. You can this type of details in grid.getQuery() method. 
 
Query: this leads me to ask the question of it is somehow possible to get the current query (where\sort) from the grid? 
 
You can get the current query of the grid by using generateQuery method. Here, we have getting current grid queries by using button click. Please find the below code snippets and sample for your reference. 
 
[code snippets] 
<div class="control-section"> 
  <button id='show' ejs-button class='e-flat' (click)='show()'> Get Current grid query </button> 
       <ejs-grid #grid [dataSource]='data' allowPaging='true' allowSorting="true" allowFiltering="true" [allowGrouping]="true" [groupSettings]="groupOptions" [pageSettings]='pageSettings' 
        height="320" (dataBound)='dataBound()' [query]='query'> 
        <e-columns> 
            ... 
       </e-columns> 
    </ejs-grid> 
</div> 
... 
export class AppComponent { 
    public data: Object[]; 
   ... 
    show() { 
        console.log(this.grid.getDataModule().generateQuery()); 
    } 
} 
 
 
Please get back to us if you need further assistance. 
 
Regards, 
Thavasianand S. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon