public override void ApplyTo(ColDef colDef, System.Reflection.PropertyInfo pi)
 {
     colDef.Filter = new FilterDef(pi.GetType());
     if (filterType != null)
     {
         colDef.Filter.type = filterType;
     }
     if (options != null && options.Any())
     {
         colDef.Filter.values = options;
     }
 }
 public override void ApplyTo(ColDef colDef, System.Reflection.PropertyInfo pi)
 {
     colDef.DisplayName      = this.ToDisplayName() ?? colDef.Name;
     colDef.Sortable         = this.Sortable;
     colDef.Visible          = this.Visible;
     colDef.Searchable       = this.Searchable;
     colDef.SortDirection    = this.SortDirection;
     colDef.MRenderFunction  = this.MRenderFunction;
     colDef.CssClass         = this.CssClass;
     colDef.CssClassHeader   = this.CssClassHeader;
     colDef.CustomAttributes = pi.GetCustomAttributes().ToArray();
     colDef.Width            = this.Width;
 }
        public static ColDef[] ColDefs(this Type t)
        {
            var propInfos  = DataTablesTypeInfo.Properties(t);
            var columnList = new List <ColDef>();

            foreach (var dtpi in propInfos)
            {
                var colDef = new ColDef(dtpi.PropertyInfo.Name, dtpi.PropertyInfo.PropertyType);
                foreach (var att in dtpi.Attributes)
                {
                    att.ApplyTo(colDef, dtpi.PropertyInfo);
                }

                columnList.Add(colDef);
            }
            return(columnList.ToArray());
        }
 public _FilterOn(TTarget target, ColDef colDef)
 {
     _target = target;
     _colDef = colDef;
 }
 public override void ApplyTo(ColDef colDef, PropertyInfo pi)
 {
     // This attribute does not affect rendering
 }
 public static DataTableConfigVm DataTableVm(this HtmlHelper html, string id, string ajaxUrl, params string[] columns)
 {
     return(new DataTableConfigVm(id, ajaxUrl, columns.Select(c => ColDef.Create(c, (string)null, typeof(string)))));
 }
 public abstract void ApplyTo(ColDef colDef, System.Reflection.PropertyInfo pi);