-
Notifications
You must be signed in to change notification settings - Fork 130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Binary and/or filter #210
Comments
I think this should work, testet it with your examples and it returned the right result.
|
Is it possible, in your case, to use calculated properties instead of complex filters? class Model {
public int Flags;
public bool HasFlag1 {
get { return (Flags & 1) == 1; }
}
} A simple boolean filter can be used then. In filter expressions, we support filtering functionality of DevExtreme data layer (docs). Technically we can extend the compiler as you suggest but it will be an undocumented extension of the spec. |
Thanks for the response! I can create a calculated field, but it would be nice to have such functionality.. Maybe you could start a request to DevExtreme.. |
Actually, we are the same team. |
Is there any change to this or will there be an update for binary operations? |
Hello @Franki1986 Starting with For CustomFilterCompilers.RegisterBinaryExpressionCompiler(info => {
if(info.Operation == "&") {
var value = Convert.ToInt32(info.Value);
return Expression.Equal(
Expression.MakeBinary(
ExpressionType.And,
Expression.Property(info.DataItemExpression, info.AccessorText),
Expression.Constant(value)
),
Expression.Constant(value)
);
}
return null;
}); Will translate |
You don't know how much this helps!!!! A great THANK YOU!!! |
Is it possible to create a binary and/or filter.
I would sy you could create as operator '&' and '|'.
so that a filter like
dataSource.filter([
[ "value", "&", 3, 1]
]);
dataSource.filter([
[ "value", "|", 1, 1]
]);
the linq expression would be (_ => (_.value | 1) == 1)
The text was updated successfully, but these errors were encountered: