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 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;
 }
예제 #4
0
        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());
        }
예제 #5
0
        public void FormatValues()
        {
            var c = new ColDef {
                WireType = Constants.TYPE_DATE
            };

            Assert.AreEqual("null", Retrovert.FormatRawJsonValue(c, null));
            Assert.AreEqual("true", Retrovert.FormatRawJsonValue(c, true));
            Assert.AreEqual("false", Retrovert.FormatRawJsonValue(c, false));
            Assert.AreEqual("254", Retrovert.FormatRawJsonValue(c, (byte)254));
            Assert.AreEqual("987654321", Retrovert.FormatRawJsonValue(c, (long)987654321));
            Assert.AreEqual("987654321.9", Retrovert.FormatRawJsonValue(c, (decimal)987654321.9));
            Assert.AreEqual("\"Jasmine\"", Retrovert.FormatRawJsonValue(c, "Jasmine"));
            Assert.AreEqual("\"The \\\"IT\\\" Crowd\"", Retrovert.FormatRawJsonValue(c, "The \"IT\" Crowd"));
            Assert.AreEqual("\"19991231\"", Retrovert.FormatRawJsonValue(c, new DateTime(1999, 12, 31)));
            c.WireType = Constants.TYPE_DATETIME;
            Assert.AreEqual("\"199912312359\"", Retrovert.FormatRawJsonValue(c, new DateTime(1999, 12, 31, 23, 59, 59, DateTimeKind.Utc)));
        }
예제 #6
0
 public override void ApplyTo(ColDef colDef, System.Reflection.PropertyInfo pi)
 {
     colDef.Filter = new FilterDef(pi.PropertyType);
     if (Selector != null)
     {
         colDef.Filter["sSelector"] = Selector;
     }
     if (filterType == "none")
     {
         colDef.Filter = null;
     }
     else
     {
         if (filterType != null)
         {
             colDef.Filter.type = filterType;
         }
         //if (options != null && options.Any()) colDef.Filter.values = options;
     }
 }
예제 #7
0
 public abstract void ApplyTo(ColDef colDef, PropertyInfo pi);
 public override void ApplyTo(ColDef colDef, PropertyInfo pi)
 {
     // This attribute does not affect rendering
 }
예제 #9
0
 public abstract void ApplyTo(ColDef colDef, System.Reflection.PropertyInfo pi);
 public override void ApplyTo(ColDef colDef, PropertyInfo pi)
 {
     colDef.SearchCols            = colDef.SearchCols ?? new JObject();
     colDef.SearchCols["sSearch"] = new DateTime(2014, 1, 1).ToString("g") + "~" + DateTimeOffset.Now.Date.AddDays(1).ToString("g");
 }
 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 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 abstract void ApplyTo(ColDef colDef, System.Reflection.PropertyInfo pi);