protected override void CreateChildControls() { base.CreateChildControls(); Controls.Clear(); ddlMainBusinessActivity = new DropDownField { Width = new Unit(300, UnitType.Pixel) }; txtOtherEntityInformation = new TextField { MaxLength = 4000, TextMode = TextBoxMode.MultiLine }; ddlMainBusinessActivity.Bind(db.GetAllBusinessActivities(), "Description", "Code"); Controls.Add(ddlMainBusinessActivity); Controls.Add(txtOtherEntityInformation); }
private void BuildFormPanel() { this.cbxReminder = new Checkbox { Ref = "../../../hasReminder", BoxLabel = "Reminder:", DataIndex = "HasReminder", Checked = false }; this.dfReminder = new DateField { Ref = "../../../reminder", Disabled = true, DataIndex = "Reminder", Width = 135 }; this.taskSubject = new TextField { AllowBlank = false, FieldLabel = "Task Subject", DataIndex = "Title", Anchor = "100%" }; this.dueDate = new DateField { AllowBlank = false, FieldLabel = "Due Date", DataIndex = "DueDate", Width = 135 }; this.taskCategory = new DropDownField { AllowBlank = false, LazyInit = false, FieldLabel = "Task List", DataIndex = "Name", Editable = false, Mode = DropDownMode.ValueText, Ref = "../../../taskCategory", Component = { new TreePanel { Height = 150, Shadow = ShadowMode.None, UseArrows = true, AutoScroll = true, Animate = true, RootVisible = false, Cls = "tasks-tree", Root = { new TreeNode("root") }, SelectionModel = { new DefaultSelectionModel() } } } }; this.description = new HtmlEditor { HideLabel = true, DataIndex = "Description", Anchor = "100% -150", EnableSourceEdit = false, EnableFont = false }; this.formPanel = new FormPanel { Region = Ext.Net.Region.Center, LabelWidth = 75, ButtonAlign = Alignment.Right, MinButtonWidth = 80, BaseCls = "x-plain", Ref = "taskForm", Cls = "task-window", RenderFormElement = false, CustomConfig = { new ConfigItem("margins", "10 10 5 10", ParameterMode.Value) }, Items = { new BoxComponent { Hidden = true, Ref = "../taskMessage", AutoEl = { Cls = "taskMessage" } }, taskSubject, new Container { Cls = "x-plain", Layout = "Hbox", Anchor = "100%", Height = 30, Items = { new Container { Width = 250, Layout = "Form", Cls = "x-pain", Items = { dueDate } }, new Container { Flex = 1, Layout = "Form", Cls = "x-plain", LabelWidth = 55, Items = { taskCategory } } } }, new BoxComponent { AutoEl = { Cls = "divider" } }, new Container { Layout = "HBox", Anchor = "100%", Cls = "x-plain", Height = 30, Items = { new Container { Width = 80, Layout = "Form", Cls = "x-plain", HideLabels = true, Items = { cbxReminder } }, new Container { Flex = 1, Layout = "Form", Cls = "x-plain", HideLabels = true, Items = { dfReminder } } } }, description } }; this.Buttons.Add(new Button ("OK")); this.Buttons.Add(new Button ("Cancel")); this.Items.Add(this.formPanel); }
private void InitLogic() { this.Listeners.Render.Fn = TasksGrid.SCOPE + ".init"; this.Listeners.Render.Scope = TasksGrid.SCOPE; this.Listeners.AfterRender.Fn = TasksGrid.SCOPE + ".afterRender"; this.Listeners.AfterRender.Scope = TasksGrid.SCOPE; ComponentDirectEvent rowDblClick = this.DirectEvents.ItemDblClick; rowDblClick.Event += RowDblClick_Event; rowDblClick.Before = "return ".ConcatWith(TaskWindow.SCOPE, ".openTask(record.getId());"); rowDblClick.Complete = TasksGrid.SCOPE + ".setIndicator(false);"; rowDblClick.ExtraParams.Add(new Parameter("taskId", "record.getId()", ParameterMode.Raw)); ComponentDirectEvent command = (this.ColumnModel.Columns[0] as CommandColumn).DirectEvents.Command; command.Event += Command_Event; command.Type = DirectEventType.Load; command.ExtraParams.Add(new Parameter("command", "command", ParameterMode.Raw)); command.ExtraParams.Add(new Parameter("taskId", "record.getId()", ParameterMode.Raw)); command.ExtraParams.Add(new Parameter("filter", TasksGrid.SCOPE + ".getFilterValue()", ParameterMode.Raw)); command.ExtraParams.Add(new Parameter("categoryID", TasksGrid.SCOPE + ".getActiveNodeCategory().getId()", ParameterMode.Raw)); command.Before = TasksGrid.SCOPE + ".setIndicator(true);"; command.Complete = TasksGrid.SCOPE + ".setIndicator(false);"; this.store.ReadData += TasksGrid_RefreshData; DropDownField ddf = ((DropDownField)this.ColumnModel.Columns[2].HeaderItems[0]); TreePanel tree = (TreePanel)(ddf.Component[0]); tree.Listeners.ItemClick.Fn = TasksGrid.SCOPE + ".categoryCheckChange"; tree.Listeners.ItemClick.Scope = TasksGrid.SCOPE; ddf.Listeners.Expand.Fn = TasksGrid.SCOPE + ".categoryExpand"; ddf.Listeners.Expand.Scope = TasksGrid.SCOPE; CommandColumn cmdCol = (CommandColumn)this.ColumnModel.Columns[0]; cmdCol.PrepareToolbar.Fn = TasksGrid.SCOPE + ".prepareStatusButton"; RowSelectionModel gridsm = (RowSelectionModel)this.SelectionModel[0]; gridsm.Listeners.SelectionChange.Fn = TasksGrid.SCOPE + ".selectionChange"; gridsm.Listeners.SelectionChange.Scope = TasksGrid.SCOPE; this.Listeners.ItemContextMenu.Fn = TasksGrid.SCOPE + ".onRowContext"; this.Listeners.ItemContextMenu.Scope = TasksGrid.SCOPE; MenuItem mItem = (MenuItem)this.ctxMenu.Items[4]; ComponentDirectEvent click = mItem.DirectEvents.Click; click.Event += DelClick_Event; click.Confirmation.ConfirmRequest = true; click.Confirmation.Message = "Are you sure you want to delete the selected task(s)?"; click.ExtraParams.Add(new Parameter("ids", TasksGrid.SCOPE + ".getSelectedIds()", ParameterMode.Raw)); click.Before = TasksGrid.SCOPE + ".setIndicator(true);"; click.Complete = TasksGrid.SCOPE + ".setIndicator(false);"; mItem = (MenuItem)this.ctxMenu.Items[3]; click = mItem.DirectEvents.Click; click.Event += MarkClick_Event; click.ExtraParams.Add(new Parameter("ids", TasksGrid.SCOPE + ".getSelectedIds()", ParameterMode.Raw)); click.ExtraParams.Add(new Parameter("filter", TasksGrid.SCOPE + ".getFilterValue()", ParameterMode.Raw)); click.ExtraParams.Add(new Parameter("categoryID", TasksGrid.SCOPE + ".getActiveNodeCategory().getId()", ParameterMode.Raw)); click.Before = TasksGrid.SCOPE + ".setIndicator(true);"; click.Complete = TasksGrid.SCOPE + ".setIndicator(false);"; mItem = (MenuItem)this.ctxMenu.Items[0]; click = mItem.DirectEvents.Click; click.Event += OpenClick_Event; click.ExtraParams.Add(new Parameter("ids", TasksGrid.SCOPE + ".getSelectedIds()", ParameterMode.Raw)); click.Before = TasksGrid.SCOPE + ".setIndicator(true);"; click.Complete = TasksGrid.SCOPE + ".setIndicator(false);"; ctxTreeCategory.Listeners.ItemClick.Fn = TasksGrid.SCOPE + ".ctxMoveTasks"; ctxTreeCategory.Listeners.ItemClick.Scope = TasksGrid.SCOPE; }
public static Panel GetEditColumn(string ShowType, Column c, string v) { if (ShowType == EditShowType.Text.ToString()) { TextField field = new TextField(c, v); return(field.Panel); } else if (ShowType == EditShowType.DateTime.ToString()) { DateTimeField field = new DateTimeField(c, v); return(field.Panel); } else if (ShowType == EditShowType.Check.ToString()) { CheckField field = new CheckField(c, v); return(field.Panel); } else if (ShowType == EditShowType.DropDownList.ToString()) { DropDownField field = new DropDownField(c, v); return(field.Panel); } else if (ShowType == EditShowType.CheckList.ToString()) { CheckListField field = new CheckListField(c, v); return(field.Panel); } else if (ShowType == EditShowType.RadioList.ToString()) { RadioListField field = new RadioListField(c, v); return(field.Panel); } else if (ShowType == EditShowType.picUpload.ToString()) { UploadImgField field = new UploadImgField(c, v); return(field.Panel); } else if (ShowType == EditShowType.MultiText.ToString()) { MultiTextField field = new MultiTextField(c, v); return(field.Panel); } else if (ShowType == EditShowType.Editor.ToString()) { EditorField field = new EditorField(c, v); return(field.Panel); } else if (ShowType == EditShowType.docUpload.ToString()) { UploadFileField field = new UploadFileField(c, v); return(field.Panel); } else if (ShowType == EditShowType.Hidden.ToString()) { Panel p = new Panel(); HiddenField field = new HiddenField(); field.ID = c.ColumnName + "_value"; field.Value = v; p.Controls.Add(field); return(p); } else if (ShowType == EditShowType.Template.ToString()) { Page page = HttpContext.Current.Handler as Page; if (page != null) { Control ctrl = page.LoadControl(c.EditTempLate); TemplateFields field = new TemplateFields(c, v, ctrl); return(field.Panel); } else { return(null); } } else { TextField field = new TextField(c, v); return(field.Panel); } }
private void BuildFormPanel() { this.cbxReminder = new Checkbox { ItemID = "hasReminder", BoxLabel = "Reminder:", Name = "HasReminder", Checked = false }; this.dfReminder = new DateField { ItemID = "reminder", Disabled = true, Name = "Reminder", Width = 135 }; this.taskSubject = new TextField { AllowBlank = false, FieldLabel = "Task Subject", Name = "Title", Anchor = "100%" }; this.dueDate = new DateField { AllowBlank = false, FieldLabel = "Due Date", Name = "DueDate", Width = 135 }; this.taskCategory = new DropDownField { AllowBlank = false, FieldLabel = "Task List", Name = "Name", Editable = false, Mode = DropDownMode.ValueText, ItemID = "taskCategory", Component = { new TreePanel { Height = 150, Shadow = false, UseArrows = true, Scrollable = ScrollableOption.Both, Animate = true, Cls = "tasks-tree", RootVisible = false, Root = { new Node { NodeID = "root", EmptyChildren = true } }, SelectionModel = { new TreeSelectionModel() } } } }; this.description = new HtmlEditor { HideLabel = true, Name = "Description", Anchor = "100% -150", EnableSourceEdit = false, EnableFont = false }; this.formPanel = new FormPanel { Region = Ext.Net.Region.Center, ButtonAlign = Alignment.Right, MinButtonWidth = 80, BaseCls = "x-plain", ItemID = "taskForm", Cls = "task-window", FieldDefaults = { LabelWidth = 75 }, CustomConfig = { new ConfigItem("margin", "10 10 5 10", ParameterMode.Value) }, Items = { new Component { Hidden = true, ItemID = "taskMessage", AutoEl = { Cls = "taskMessage" } }, taskSubject, new Container { Cls = "x-plain", Layout = "Hbox", Anchor = "100%", Height = 30, Items = { new Container { Width = 250, Layout = "Form", Cls = "x-pain", Items = { dueDate } }, new Container { Flex = 1, Layout = "Form", Cls = "x-plain", Items = { taskCategory }, Defaults = { new Parameter() { Name = "LabelWidth", Value = "55", Mode = ParameterMode.Raw } } } } }, new Component { AutoEl = { Cls = "divider" } }, new Container { Layout = "HBox", Anchor = "100%", Cls = "x-plain", Height = 30, Items = { new Container { Width = 80, Layout = "Form", Cls = "x-plain", Items = { cbxReminder }, Defaults = { new Parameter() { Name = "HideLabel", Value = "true", Mode = ParameterMode.Raw } } }, new Container { Flex = 1, Layout = "Form", Cls = "x-plain", Items = { dfReminder }, Defaults = { new Parameter() { Name = "HideLabel", Value = "true", Mode = ParameterMode.Raw } } } } }, description } }; this.Buttons.Add(new Button("OK")); this.Buttons.Add(new Button("Cancel")); this.Items.Add(this.formPanel); }
public void ClearControl(Control control, bool setcolor) { TextField tf = control as TextField; NumberField nf = control as NumberField; TextArea ta = control as TextArea; SpinnerField sf = control as SpinnerField; Checkbox cb = control as Checkbox; DropDownField ddf = control as DropDownField; ComboBox cbb = control as ComboBox; DateField df = control as DateField; TriggerField tgf = control as TriggerField; MultiCombo mc = control as MultiCombo; if (setcolor) { if (tgf != null) { tgf.Reset(); tgf.StyleSpec = "color:black"; } if (df != null) { df.Reset(); df.Call("setMaxValue", null); df.Call("setMinValue", null); df.StyleSpec = "color:black"; } if (mc != null) { mc.Reset(); mc.StyleSpec = "color:black"; } if (cbb != null) { cbb.Reset(); cbb.StyleSpec = "color:black"; } if (ddf != null) { ddf.Reset(); ddf.StyleSpec = "color:black"; } if (cb != null) { cb.Reset(); cb.StyleSpec = "color:black"; } if (sf != null) { sf.Reset(); sf.StyleSpec = "color:black"; } if (ta != null) { ta.Reset(); ta.StyleSpec = "color:black"; } if (nf != null) { nf.Reset(); nf.StyleSpec = "color:black"; } if (tf != null) { tf.Reset(); tf.StyleSpec = "color:black"; } if (control.HasControls()) { foreach (Control child in control.Controls) { ClearControl(child, setcolor); } } } else { if (tgf != null) { tgf.Reset(); } if (df != null) { df.Reset(); df.Call("setMaxValue", null); df.Call("setMinValue", null); } if (mc != null) { mc.Reset(); } if (cbb != null) { cbb.Reset(); } if (ddf != null) { ddf.Reset(); } if (cb != null) { cb.Reset(); } if (sf != null) { sf.Reset(); } if (ta != null) { ta.Reset(); } if (nf != null) { nf.Reset(); } if (tf != null) { tf.Reset(); } if (control.HasControls()) { foreach (Control child in control.Controls) { ClearControl(child, setcolor); } } } }
private void BuildFormPanel() { this.cbxReminder = new Checkbox { Ref = "../../../hasReminder", BoxLabel = "Reminder:", DataIndex = "HasReminder", Checked = false }; this.dfReminder = new DateField { Ref = "../../../reminder", Disabled = true, DataIndex = "Reminder", Width = 135 }; this.taskSubject = new TextField { AllowBlank = false, FieldLabel = "Task Subject", DataIndex = "Title", Anchor = "100%" }; this.dueDate = new DateField { AllowBlank = false, FieldLabel = "Due Date", DataIndex = "DueDate", Width = 135 }; this.taskCategory = new DropDownField { AllowBlank = false, LazyInit = false, FieldLabel = "Task List", DataIndex = "Name", Editable = false, Mode = DropDownMode.ValueText, Ref = "../../../taskCategory", Component = { new TreePanel { Height = 150, Shadow = ShadowMode.None, UseArrows = true, AutoScroll = true, Animate = true, RootVisible = false, Cls = "tasks-tree", Root = { new TreeNode("root") }, SelectionModel = { new DefaultSelectionModel() } } } }; this.description = new HtmlEditor { HideLabel = true, DataIndex = "Description", Anchor = "100% -150", EnableSourceEdit = false, EnableFont = false }; this.formPanel = new FormPanel { Region = Ext.Net.Region.Center, LabelWidth = 75, ButtonAlign = Alignment.Right, MinButtonWidth = 80, BaseCls = "x-plain", Ref = "taskForm", Cls = "task-window", RenderFormElement = false, CustomConfig = { new ConfigItem("margins", "10 10 5 10", ParameterMode.Value) }, Items = { new BoxComponent { Hidden = true, Ref = "../taskMessage", AutoEl = { Cls = "taskMessage" } }, taskSubject, new Container { Cls = "x-plain", Layout = "Hbox", Anchor = "100%", Height = 30, Items = { new Container { Width = 250, Layout = "Form", Cls = "x-pain", Items = { dueDate } }, new Container { Flex = 1, Layout = "Form", Cls = "x-plain", LabelWidth = 55, Items = { taskCategory } } } }, new BoxComponent { AutoEl = { Cls = "divider" } }, new Container { Layout = "HBox", Anchor = "100%", Cls = "x-plain", Height = 30, Items = { new Container { Width = 80, Layout = "Form", Cls = "x-plain", HideLabels = true, Items = { cbxReminder } }, new Container { Flex = 1, Layout = "Form", Cls = "x-plain", HideLabels = true, Items = { dfReminder } } } }, description } }; this.Buttons.Add(new Button("OK")); this.Buttons.Add(new Button("Cancel")); this.Items.Add(this.formPanel); }
protected override void CreateChildControls() { base.CreateChildControls(); Controls.Clear(); _txtAddressType = new DropDownField(); _txtAddressType.Items.AddRange(new[] { new ListItem("SELECT", ""), new ListItem("Residential Or Business", "OECD301"), new ListItem("Residential", "OECD302"), new ListItem("Business", "OECD303"), new ListItem("Registered Office", "OECD304") }); _ddlAddressOption = new DropDownField() { AutoPostBack = true }; _ddlAddressOption.Items.AddRange(new[] { new ListItem("SELECT", ""), new ListItem("PO Box", "01"), new ListItem("Private Bag", "02"), new ListItem("Other PO Special Service (specify)", "03") }); _ddlAddressOption.SelectedIndexChanged += TxtAddressOption_SelectedIndexChanged; _txtOtherSpecify = new TextField() { MaxLength = 10, Enabled = false }; _txtAddressNumber = new TextField { MaxLength = 8 }; _txtPostOffice = new TextField { MaxLength = 22 }; _txtPostOfficePostCode = new TextField { MaxLength = 10 }; _ddlPostOfficeCountryCode = new CountryList { Width = DropdownListWith }; _txtUnitNumber = new TextField() { MaxLength = 5 }; _txtComplexName = new TextField() { MaxLength = 26 }; _txtStreetNo = new TextField() { MaxLength = 8 }; _txtStreetOrFarmName = new TextField { MaxLength = 24 }; _txtSuburbOrDistrict = new TextField { MaxLength = 33 }; _txtCityOrTownName = new TextField { MaxLength = 33 }; _txtResPostalCode = new TextField { MaxLength = 10 }; _ddlResAddressCountryCode = new CountryList { Width = DropdownListWith }; Controls.Add(_txtAddressType); Controls.Add(_ddlAddressOption); Controls.Add(_txtOtherSpecify); Controls.Add(_txtAddressNumber); Controls.Add(_txtPostOffice); Controls.Add(_txtPostOfficePostCode); Controls.Add(_ddlPostOfficeCountryCode); Controls.Add(_txtUnitNumber); Controls.Add(_txtComplexName); Controls.Add(_txtStreetNo); Controls.Add(_txtStreetOrFarmName); Controls.Add(_txtSuburbOrDistrict); Controls.Add(_txtCityOrTownName); Controls.Add(_txtResPostalCode); Controls.Add(_ddlResAddressCountryCode); }