예제 #1
0
 public SortModel(IFieldColumn column, LambdaExpression getFieldExpression, string fieldName, int priority, SortDirection defaultSortOrder, Func <TField, TField, int> comparer)
 {
     this.Priority            = priority;
     this._columnIndex        = column.ColIndex;
     this._getFieldExpression = getFieldExpression;
     this.FieldName           = fieldName;
     this._comparer           = comparer;
     this._sortDirection      = defaultSortOrder ?? SortDirection.None;
 }
예제 #2
0
 public FilterModel(IFieldColumn column, LambdaExpression getFieldExpression, string fieldName, Expression <Func <TField, TField, bool> > onFilter, IList <TableFilter> filters, TableFilterType filterType)
 {
     this._getFieldExpression = getFieldExpression;
     this.FieldName           = fieldName;
     if (onFilter == null)
     {
         this.OnFilter = (value, field) => field.Equals(value);
     }
     else
     {
         this.OnFilter = onFilter;
     }
     this.SelectedValues = filters.Select(x => x.Value?.ToString());
     this.Filters        = filters;
     this.FilterType     = filterType;
     this._columnIndex   = column.ColIndex;
 }