How can I get an ej.Query to act like ej.Grid's filteredColumns property?
ejGrid.filterSettings.filterColumns takes an array of filter objects, which has a "predicate" field allowing the choice between "and" or "or" clauses combining the various filters. ejQuery only has a "where" method, which does not accept parameter objects, but accepts arguments shaped like a filter except for the "predicate" field.
Is there a way to chain ejQuery where methods such that they use an "or" predicate rather than an "and" predicate?
Is there ejQuery.where or filterColumn.operator support for the SQL "IN" operator?
How to I get ejQuery to submit something that tells the ASP.NET MVC DataManager to combine clauses with OR rather than AND?
Example: $("#grid").ejGrid({ dataSource: new ej.DataManager({ adaptor: new ej.UrlAdaptor(), url: ... }), ... });
later ...
var filters = [{field: "field", operator: "equal", value: "something", predicate: "or"}, {{field: "field", operator: "equal", value: "else", predicate: "or"}];
var grid = $("#grid").ejGrid("instance");
grid.model.filterSettings.filteredColumns = filters;
grid.refreshContents()
---> [SELECT ... FROM ... WHERE field = 'something' OR field = 'else']
If I try:
var dm = new ej.DataManager({ adaptor: new ej.UrlAdaptor(), url: ...});
var q = new ej.Query().where("field", "equal", "something").where("field", "equal", "else");
q.execute(dm).then(function (r) { console.log(r);});
---> [SELECT ... FROM ... WHERE field = 'something' AND field = 'else']
How can I get the queries to be the same using ej.Query?
Thanks in advance.