internal static DatePicker SetupSimpleDatePickerObject(TextWriter writer) { // nothing special, just create a simple dummy tab helper as a starting point // (saves having the same code everywhere!) DatePicker dt = new DatePicker(writer, "dt"); return dt; }
public void ConfigureDatePicker(DatePicker dt) { dt .Rendering .SetAutoScript(false) .SetTabDepth(1) .Finish() .Options .SetShowOn("both") .SetChangeYear(true) .SetChangeMonth(true) .SetYearRange("-100") ; }
/// <summary> /// Constructor /// </summary> /// <param name="dp">DatePicker object to define events for</param> public Events(DatePicker dp) : base() { this.DatePicker = dp; this.Reset(); }
public void ConfigureDatePicker(DatePicker dt) { // make the input a bit wider than our default style dt.WithCss("wide"); dt .Rendering .SetPrettyRender(true) .Finish() .Options .SetDisabled(this.Disabled) .SetAltField(this.AltField) .SetAltFormat(this.AltFormat) .SetAppendText(this.AppendText) .SetAutoSize(this.AutoSize) .SetButtonImage(this.ButtonImage) .SetButtonImageOnly(this.ButtonImageOnly) .SetButtonText(this.ButtonText) .SetCalculateWeek(this.CalculateWeek) .SetChangeMonth(this.ChangeMonth) .SetChangeYear(this.ChangeYear) .SetCloseText(this.CloseText) .SetConstrainInput(this.ConstrainInput) .SetCurrentText(this.CurrentText) .SetDateFormat(this.DateFormat) .SetDefaultDate(this.DefaultDate) .SetDuration(this.Duration) .SetFirstDay(this.FirstDay) .SetGotoCurrent(this.GotoCurrent) .SetHideIfNoPrevNext(this.HideIfNoPrevNext) .SetIsRTL(this.IsRTL) .SetMaxDate(this.MaxDate) .SetMinDate(this.MinDate) .SetNavigationAsDateFormat(this.NavigationAsDateFormat) .SetNextText(this.NextText) .SetNumberOfMonths(this.NumberOfMonths) .SetPrevText(this.PrevText) .SetSelectOtherMonths(this.SelectOtherMonths) .SetShortYearCutoff(this.ShortYearCutoff) .SetShowAnim(this.ShowAnim) .SetShowButtonPanel(this.ShowButtonPanel) .SetShowMonthAfterYear(this.ShowMonthAfterYear) .SetShowOn(this.ShowOn) .SetShowOtherMonths(this.ShowOtherMonths) .SetShowWeek(this.ShowWeek) .SetStepMonths(this.StepMonths) .SetWeekHeader(this.WeekHeader) .SetYearRange(this.YearRange) .SetYearSuffix(this.YearSuffix) .SetShowInline(this.ShowInline) .Finish(); if (this.FakeDayNamesChange) { dt.Options .SetDayNames(this.DayNames) .SetDayNamesMin(this.DayNamesMin) .SetDayNamesShort(this.DayNamesShort) .Finish(); } if (this.FakeMonthNamesChange) { dt.Options .SetMonthNames(this.MonthNames) .SetMonthNamesShort(this.MonthNamesShort) .Finish(); } if (this.showEvents) { dt.Events .SetCreateEvent("return createEvent(event, ui);") .SetBeforeShowEvent("return beforeShowEvent(input, inst);") .SetBeforeShowDayEvent("return beforeShowDayEvent(date);") .SetOnChangeMonthYearEvent("return onChangeMonthYear(year, month, inst);") .SetOnCloseEvent("return onClose(dateText, inst);") .SetOnSelectEvent("return onSelect(dateText, inst);") .Finish() ; } if (!this.prettyRender) dt.Rendering.Compress(); if (this.renderCSS) dt.Rendering.ShowCSS(); }
/// <summary> /// Constructor /// </summary> /// <param name="dp">DatePicker object to call</param> public Methods(DatePicker dp) : base(dp) { }
public string JavaScriptCode(DatePicker dt) { dt.Rendering.SetPrettyRender(true); return dt.GetStartUpScript(); }
public string CSharpCode(DatePicker dt) { jStringBuilder sb = new jStringBuilder(true/*includeWhitespace*/, 0); sb.AppendTabsLineIf("<%"); sb.AppendTabsFormatLineIf("Html.CreateDatePicker(\"{0}\")", dt.ID); string optionsCode = OptionsCSharpCode(); string showEventsCode = ShowEventsCSharpCode(); string renderCode = base.RenderCSharpCode(); bool showOptions = (optionsCode.Length > 0 || showEventsCode.Length > 0 || renderCode.Length > 0); if (showOptions) { sb.IncIndent(); if (optionsCode.Length > 0) { sb.AppendTabsLineIf(".Options"); sb.IncIndent(); sb.Append(optionsCode); sb.DecIndent(); sb.AppendTabsLineIf(".Finish()"); } if (showEventsCode.Length > 0) { sb.AppendTabsLineIf(".Events"); sb.IncIndent(); sb.Append(showEventsCode); sb.DecIndent(); sb.AppendTabsLineIf(".Finish()"); } if (renderCode.Length > 0) sb.Append(renderCode); sb.DecIndent(); } sb.AppendTabsLineIf(".Render();"); sb.AppendTabsLineIf("%>"); return sb.ToString(); }
/// <summary> /// Constructor /// </summary> /// <param name="dp">DatePicker to configure options of</param> public Options(DatePicker dp) : base() { this.DatePicker = dp; this.Reset(); }
/// <summary> /// Creates a DatePicker control that can be later rendered onto the page. /// </summary> /// <param name="page">WebForms page to render the control onto</param> /// <param name="id">ID to give to the accordion (must be unique on the page)</param> /// <returns>Created DatePicker control</returns> public static DatePicker CreateDatePicker(this System.Web.UI.Page page, string id) { TextWriter writer = page.Response.Output; DatePicker newTabs = new DatePicker(writer, id); return newTabs; }
/// <summary> /// Creates a DatePicker control that can be later rendered onto the page. /// </summary> /// <param name="html">Html helper (used to get the HttpResponse object to render onto)</param> /// <param name="id">ID to give to the accordion (must be unique on the page)</param> /// <returns>Created DatePicker control</returns> public static DatePicker CreateDatePicker(this HtmlHelper html, string id) { TextWriter writer = html.ViewContext.Writer; DatePicker newTabs = new DatePicker(writer, id); return newTabs; }
public string JavaScriptCode(DatePicker dt) { return dt.GetStartUpScript(); }
/// <summary> /// Constructor /// </summary> /// <param name="dt">DatePicker object to set rendering options of</param> public Rendering(DatePicker dt) : base() { this.DatePicker = dt; }