public static IHtmlContent TextCell <T, TValue>(this IHtmlHelper <T> helper, Expression <Func <T, TValue> > exp,
                                                        object cellAttributes = null)
        {
            var        Provider = helper.GetService <ITablesHelper>();
            CellWriter mod      = Provider.TextCell(helper, exp, cellAttributes);

            return(mod.WriteCell(CellTypes.LabelCell));
        }
        public virtual CellWriter DragHeaderCell <T>(IHtmlHelper <T> helper, string tableName, string width, object cellAttributes)
        {
            var writer = new CellWriter(helper);

            writer.Initialize(null, width, cellAttributes, null);
            writer.InputModel.PlaceHolder = RazorConfig.LocaleTextProvider.Word("Drag");
            return(writer);
        }
        public virtual CellWriter DragContentCell <T>(IHtmlHelper <T> helper, string tableName, string modelName, string width, object cellAttributes)
        {
            var writer = new CellWriter(helper);

            writer.Initialize(null, null, cellAttributes, null);
            writer.InputModel.NgModelName = modelName ?? helper.GetModelName();

            return(writer);
        }
 public virtual CellWriter TextCell <T, TValue>(IHtmlHelper <T> helper, Expression <Func <T, TValue> > exp, object cellAttributes)
 {
     using (var writer = new CellWriter(helper))
     {
         writer.UseExpression(exp);
         writer.Initialize(null, null, cellAttributes, null);
         return(writer);
     }
 }
        public static IHtmlContent DragHeaderCell <T>(this IHtmlHelper <T> helper,
                                                      string tableName,
                                                      string width          = null,
                                                      object cellAttributes = null)
        {
            var        Provider = helper.GetService <ITablesHelper>();
            CellWriter writer   = Provider.DragHeaderCell <T>(helper, tableName, width, cellAttributes);

            return(writer.WriteHeaderCell());
        }
        public virtual CellWriter CalendarCell <T, TValue>(IHtmlHelper <T> helper, Expression <Func <T, TValue> > exp, CalendarTypes rangeType, Calendars cals, DateRange range, bool required, object cellAttributes, object inputAttr, string classes)
        {
            var writer = new CellWriter(helper);

            writer.UseExpression(exp);

            writer.Initialize(null, null, cellAttributes, inputAttr, classes);


            return(writer);
        }
 public virtual CellWriter HeaderCell <T, TValue>(IHtmlHelper <T> helper, Expression <Func <T, TValue> > exp, string size, object cellAttributes, bool sorting)
 {
     using (var writer = new CellWriter(helper))
     {
         writer.UseExpression(exp);
         writer.Initialize(null, size, cellAttributes, null);
         writer.ColumnModel.Sorting    = sorting;
         writer.InputModel.PlaceHolder = RazorConfig.LocaleTextProvider.Column(writer.ColumnId);
         return(writer);
     }
 }
 public virtual CellWriter HeaderCell(IHtmlHelper helper, string textId, string size, bool isColumn, object cellAttributes, bool sorting)
 {
     using (var writer = new CellWriter(helper))
     {
         writer.ColumnModel.MemberName = textId;
         writer.ColumnModel.Sorting    = sorting;
         writer.ColumnModel.Attributes = cellAttributes == null ? "" : RazorUtils.ToAttributeString(cellAttributes);
         writer.InputModel.PlaceHolder = isColumn ? RazorConfig.LocaleTextProvider.Column(textId) : RazorConfig.LocaleTextProvider.Word(textId);
         return(writer);
     }
 }
        public static IHtmlContent LinkCell <T, TValue>(this IHtmlHelper <T> helper, Expression <Func <T, TValue> > exp,
                                                        string url,
                                                        bool blank            = true,
                                                        object cellAttributes = null,
                                                        object linkAttributes = null,
                                                        string pipe           = null)
        {
            var        Provider = helper.GetService <ITablesHelper>();
            CellWriter writer   = Provider.LinkCell(helper, exp, url, blank, cellAttributes, linkAttributes, pipe);

            return(writer.Write(InputControls.Label));
        }
        public static IHtmlContent TextBoxCell <T, TValue>(this IHtmlHelper <T> helper, Expression <Func <T, TValue> > exp,
                                                           string textBoxType         = "text",
                                                           IValidationCollection coll = null,
                                                           object cellAttributes      = null,
                                                           object inputAttr           = null,
                                                           string classes             = "")
        {
            var        Provider = helper.GetService <ITablesHelper>();
            CellWriter mod      = Provider.TextBoxCell(helper, exp, textBoxType, null, coll, cellAttributes, inputAttr, classes);

            return(mod.Write(InputControls.TextBox));
        }
        public virtual CellWriter SelectCell <T, TValue>(IHtmlHelper <T> helper, Expression <Func <T, TValue> > exp, Lister source, string displayMember, string valueMember, bool required, bool multi, object cellAttributes, object inputAttr, string classes, bool nullable, string rowIndex)
        {
            var writer = new CellWriter(helper);

            writer.UseExpression(exp);
            writer.Initialize(null, null, cellAttributes, inputAttr, classes);
            writer.InputModel = writer.InputModel.GetSelectInput(source.IsLookup ? "Lookups." + source.ListName : source.ListName, displayMember, valueMember, multi, nullable);
            if (required)
            {
                writer.UseValidation(helper.VCollection().AddRequired(), rowIndex: rowIndex);
            }
            return(writer);
        }
        public static IHtmlContent HeaderCell <T, TValue>(this IHtmlHelper <T> helper, Expression <Func <T, TValue> > exp,
                                                          string size = null,

                                                          object cellAttributes = null,
                                                          bool?sorting          = null)
        {
            var Provider = helper.GetService <ITablesHelper>();

            sorting = sorting ?? helper.GetTheme().SortingInTables;
            CellWriter mod = Provider.HeaderCell(helper, exp, size, cellAttributes, sorting.Value);

            return(mod.WriteHeaderCell());
        }
        public static IHtmlContent HeaderCell(this IHtmlHelper helper,
                                              string text,
                                              string size           = null,
                                              bool isColumn         = true,
                                              object cellAttributes = null,
                                              bool?sorting          = null)
        {
            var Provider = helper.GetService <ITablesHelper>();

            sorting = sorting ?? helper.GetTheme().SortingInTables;
            CellWriter mod = Provider.HeaderCell(helper, text, size, isColumn, cellAttributes, sorting.Value);

            return(mod.WriteHeaderCell());
        }
        public virtual CellWriter TextBoxCell <T, TValue>(IHtmlHelper <T> helper, Expression <Func <T, TValue> > exp, string textBoxType, string rowIndex, IValidationCollection coll, object cellAttributes, object inputAttr, string classes)
        {
            var writer = new CellWriter(helper);

            writer.UseExpression(exp);

            writer.InputModel.TextBoxType = textBoxType;
            writer.InputModel.RowIndex    = rowIndex;
            writer.Initialize(null, null, cellAttributes, inputAttr, classes);
            if (coll != null)
            {
                writer.UseValidation(coll, rowIndex: rowIndex);
            }
            return(writer);
        }
        public static IHtmlContent CalendarCell <T, TValue>(
            this IHtmlHelper <T> helper,
            Expression <Func <T, TValue> > exp,
            CalendarTypes rangeType = CalendarTypes.PastAndFuture,
            Calendars cals          = Calendars.Greg,
            DateRange range         = null,
            bool required           = false,
            object cellAttributes   = null,
            object inputAttr        = null,
            string classes          = "")
        {
            var        Provider = helper.GetService <ITablesHelper>();
            CellWriter mod      = Provider.CalendarCell(helper, exp, rangeType, cals, range, required, cellAttributes, inputAttr, classes);

            return(mod.Write(InputControls.CalendarTextBox));
        }
        public static IHtmlContent SelectCell <T, TValue>(this IHtmlHelper <T> helper, Expression <Func <T, TValue> > exp,
                                                          Lister source,
                                                          string displayMember,
                                                          string valueMember    = null,
                                                          bool required         = false,
                                                          bool multi            = false,
                                                          object cellAttributes = null,
                                                          object inputAttr      = null,
                                                          string classes        = "",
                                                          bool nullable         = false,
                                                          string rowIndex       = null)
        {
            var        Provider = helper.GetService <ITablesHelper>();
            CellWriter mod      = Provider.SelectCell(helper, exp, source, displayMember, valueMember, required, multi, cellAttributes, inputAttr, classes, nullable, rowIndex);

            return(mod.Write(InputControls.Select));
        }
        public CellWriter LinkCell <T, TValue>(IHtmlHelper <T> helper, Expression <Func <T, TValue> > exp, string url, bool blank, object cellAttributes, object linkAttributes, string pipe)
        {
            var writer = new CellWriter(helper);

            writer.UseExpression(exp);
            writer.Initialize(null, null, cellAttributes, null);
            if (url != null)
            {
                url = RazorUtils.ApplyConvension(url, AppParts.Route);
            }
            writer.InputModel = writer.InputModel.GetLabelInput(pipe, url, blank);
            pipe = pipe == null ? "" : " | " + pipe;
            if (pipe.Contains("translate"))
            {
                writer.InputModel.NgModelName = "'Words.'+" + writer.InputModel.NgModelName;
            }

            writer.InputModel.MemberName += pipe;
            return(writer);
        }
        public virtual CellWriter SelectorCellMulti <T>(IHtmlHelper <T> helper, string field, string rowIndex, string listName, string ngModel, object cellAttributes, object inputAttr, string listItem, string classes)
        {
            var writer = new CellWriter(helper);

            //writer.AddToControls("SelectorCell");

            //if (!writer.GetAccessibility().Write)
            //    return new HtmlString("");

            string lItem = helper.GetModelName() + "." + (listItem ?? "Tag");

            writer.Initialize(null, null, cellAttributes, inputAttr, classes);
            writer.InputModel            = writer.InputModel.GetCheckInput(null, null, false, lItem);
            writer.InputModel.MemberName = helper.GetModelName() + "." + ngModel;
            writer.InputModel.FieldName  = "'" + field + "'+" + rowIndex;

            writer.InputModelExtraAttrs.evnt__change = helper.GetModelName() + $".Tag.ApplyTo({listName})";

            return(writer);
        }