I have a grid in an MVC environment. I have my filterable properties set up as follows:
.Filterable(filterable => filterable
.Extra(false)
.Operators(operators => operators
.ForString(str => str.Clear()
.StartsWith("Starts with")
.IsEqualTo("Equal to")
.IsNotEqualTo("Not equal to")
.Contains("Contains")
)
.ForNumber(number => number.Clear()
.IsEqualTo("Equal to")
.IsNotEqualTo("Not equal to")
.IsGreaterThanOrEqualTo("Greater than or equal to")
.IsLessThanOrEqualTo("Less than or equal to")
.IsGreaterThan("Greater than")
.IsLessThan("Less than")
)
.ForDate(date => date.Clear()
.IsEqualTo("Equal to")
.IsNotEqualTo("Not equal to")
.IsGreaterThanOrEqualTo("Greater than or equal to")
.IsLessThanOrEqualTo("Less than or equal to")
.IsGreaterThan("Greater than")
.IsLessThan("Less than")
)
)
)
I have two questions:
1) I have a column in my grid that I do not want filterable. How do I exclude just that one column?
2) I am using these same filterable operators on all my grids in my app. Is there some way I can avoid repeating all this code for each grid and just provide some sort of reference to these defined operator values?