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

ejDataManager ejQuery


What are or where can I find a list of "conditional Operators" for ej.Query().where("fieldName","operator","value")

e.g. dm = ej.DataManager(window.gridData).executeLocal(ej.Query().where("OrderID","lessthan","10253"));

Is it possible to have an AND condition in the where such as
OrderID > 10253 AND OrderID < 12000

How would I get the result of OrderID in (10253, 10254, 10258, 10260, 10264)

Thanks

Morgan



3 Replies

RU Ragavee U S Syncfusion Team June 13, 2016 04:44 AM UTC

Hi Morgan, 

Thanks for contacting Syncfusion support. 

Query #1: What are or where can I find a list of "conditional Operators" for ej.Query().where 

Please refer to the below online documentation where we have listed out and explained about the various operators supported by the filter query. 


Query #2: Is it possible to have an AND condition in the where 

Yes. We can achieve your requirement to perform AND/OR operation on two filter queries using the ej.Predicate helper function. Please refer to the below online documentation for more information. 


Query #3: How would I get the result of OrderID in (10253, 10254, 10258, 10260, 10264) 

We can achieve the above requirement using the below complex query generated using the or predicate. 

ej.Query().where( 
        ej.Predicate("OrderID", ej.FilterOperators.equal, 10253, true) 
        .or("OrderID", ej.FilterOperators.equal, 10254, true) 
        .or("OrderID", ej.FilterOperators.equal, 10258, true) 
        .or("OrderID", ej.FilterOperators.equal, 10260, true) 
        .or("OrderID", ej.FilterOperators.equal, 10264, true)); 



Regards, 
Ragavee U S. 



MO Morgan June 13, 2016 07:44 AM UTC

Thanks very much for your reply.

It answers all my queries.

I had been searching the API Reference section of the Documentation. 
I did not realized that the answers were in the DataManager section.

Thanks again

Morgan


RU Ragavee U S Syncfusion Team June 14, 2016 03:54 AM UTC

Hi Morgan, 
  
Thanks for your update. 
  
We are happy that your requirement is achieved. 
  
Regards, 
Ragavee U S. 


Loader.
Up arrow icon