示例#1
0
        /// <summary>
        ///
        /// </summary>
        public TimeField.Builder TimeField(TimeField component)
        {
#if MVC
            component.ViewContext = this.HtmlHelper != null ? this.HtmlHelper.ViewContext : null;
#endif
            return(new TimeField.Builder(component));
        }
示例#2
0
        protected override Control AddEditor(Control container)
        {
            CompositeField placeHolder = new CompositeField();

            DateField tb = new DateField();
            tb.ID = Name;
            if (Required)
            {
                tb.AllowBlank = false;
                tb.Cls = "required";
            }
            placeHolder.Items.Add(tb);

            if (IncludeTime)
            {
                TimeField timeField = new TimeField();
                timeField.ID = Name + "Time";
                timeField.Width = 70;
                if (Required)
                {
                    timeField.AllowBlank = false;
                    timeField.Cls += " required";
                }
                placeHolder.Items.Add(timeField);
            }

            container.Controls.Add(placeHolder);
            container.Controls.Add(new LiteralControl("<br />"));

            return placeHolder;
        }
        public void ShowDialog(int id)
        {
            ContentItem contentItem = Engine.Persister.Get(id);

            var window = new Window
            {
                ID = "pageCachingSettings",
                Title = @"Page Caching Settings",
                Width = 500,
                Height = 300,
                Layout = "fit",
                Modal = true
            };

            var formPanel = new FormPanel { Padding = 5 };
            var formLayout = new FormLayout();
            formPanel.ContentControls.Add(formLayout);
            window.Items.Add(formPanel);

            var chkEnableCache = new Checkbox
            {
                ID = "chkEnableCache",
                FieldLabel = @"Enable page cache?",
                LabelSeparator = "",
                Checked = contentItem.GetPageCachingEnabled()
            };
            formLayout.Anchors.Add(new Anchor(chkEnableCache));

            var tmeCacheDuration = new TimeField
            {
                ID = "tmeCacheDuration",
                FieldLabel = @"Cache duration",
                Width = 80,
                SelectedTime = contentItem.GetPageCachingDuration()
            };
            formLayout.Anchors.Add(new Anchor(tmeCacheDuration));

            Button btnSave = new Button { Text = @"Save" };
            window.Buttons.Add(btnSave);
            btnSave.Listeners.Click.Handler = string.Format(
                "stbStatusBar.showBusy(); Ext.net.DirectMethods.PageCaching.SavePageCachingSettings({0}, Ext.getCmp('{1}').getValue(), Ext.getCmp('{2}').getValue(), {{ url: '{4}', success: function() {{ stbStatusBar.setStatus({{ text: 'Saved page caching settings', iconCls: '', clear: true }}); }} }}); {3}.close();",
                id, chkEnableCache.ClientID, tmeCacheDuration.ClientID, window.ClientID, Engine.AdminManager.GetAdminDefaultUrl());

            Button btnCancel = new Button { Text = @"Cancel" };
            window.Buttons.Add(btnCancel);
            btnCancel.Listeners.Click.Handler = string.Format("{0}.close();", window.ClientID);

            window.Render(pnlContainer, RenderMode.RenderTo);
        }
示例#4
0
 /// <summary>
 ///
 /// </summary>
 public TimeField.Builder TimeField(TimeField component)
 {
     return(new TimeField.Builder(component));
 }