Inheritance: CheckboxGroupBase, IItems
        /// <summary>
        ///
        /// </summary>
        public CheckboxGroup.Builder CheckboxGroup(CheckboxGroup component)
        {
#if MVC
            component.ViewContext = this.HtmlHelper != null ? this.HtmlHelper.ViewContext : null;
#endif
            return(new CheckboxGroup.Builder(component));
        }
Exemple #2
0
 /// <summary>
 ///
 /// </summary>
 public CheckboxGroup.Builder CheckboxGroup(CheckboxGroup component)
 {
     return(new CheckboxGroup.Builder(component));
 }
        private void InitComponent()
        {
            #region Button
            btnAddUser = new Button {
                ID = "btnAddUser", Text = "Add User", Icon = Icon.UserAdd
            };
            btnDelete = new Button {
                ID = "btnDelete", Text = "Delete User", Icon = Icon.UserDelete
            };
            #endregion Button

            #region Card
            txtUserName = new TextField
            {
                ID         = "txtUserName",
                EmptyText  = "Enter username",
                Flex       = 1,
                LabelWidth = 80,
                FieldLabel = "Username",
                AllowBlank = false
            };

            txtFullName = new TextField
            {
                ID         = "txtFullName",
                EmptyText  = "Enter full name",
                Flex       = 1,
                LabelWidth = 80,
                FieldLabel = "Full name",
                AllowBlank = false
            };

            cbgCinema = new CheckboxGroup
            {
                ID            = "cbgCinema",
                FieldLabel    = "Cinema",
                ColumnsNumber = 3,
                Cls           = "x-check-group-alt"
            };

            cboLocation = new ComboBox
            {
                ID         = "cboLocation",
                FieldLabel = "Location",
                EmptyText  = "Enter Location",
                Flex       = 1,
                LabelWidth = 80,
                AllowBlank = false
            };

            cboBatch = new ComboBox
            {
                ID         = "cboBatch",
                EmptyText  = "Enter Batch",
                Flex       = 1,
                LabelWidth = 80,
                FieldLabel = "Batch",
                AllowBlank = false
            };

            rdgRole = new RadioGroup
            {
                ID            = "rdgRole",
                FieldLabel    = "Role",
                ColumnsNumber = 1,
                Items         =
                {
                    new Radio {
                        ID = "rdoAdmin", BoxLabel = "Admin", Value = "Admin", InputValue = "Admin"
                    },
                    new Radio {
                        ID = "rdoFnb", BoxLabel = "F&B", Value = "FnB", InputValue = "FnB"
                    },
                    new Radio {
                        ID = "rdoAccSite", BoxLabel = "Accounting Site", Value = "AccSite", InputValue = "AccSite", Checked = true
                    },
                    new Radio {
                        ID = "rdoCM", BoxLabel = "Cinema Manager", Value = "CM", InputValue = "CM"
                    }
                }
            };

            cboCompanyCard = new ComboBox {
                ID         = "cboCompanyCard",
                EmptyText  = "Enter company",
                Flex       = 1,
                LabelWidth = 80,
                FieldLabel = "Company",
                AllowBlank = false
            };
            #endregion

            #region Account
            strUsername = new Store
            {
                ID    = "strUsername",
                Model =
                {
                    new Model              {
                        Fields =
                        {
                            new ModelField {
                                Name = "Account"
                            },
                            new ModelField {
                                Name = "Fullname"
                            },
                        }
                    }
                }
            };

            cboUsername = new Ext.Net.ComboBox
            {
                DataIndex     = "Account",
                Name          = "Account",
                LabelWidth    = 80,
                Anchor        = "100%",
                FieldLabel    = "Account",
                ID            = "cboUsername",
                SelectOnFocus = true,
                AllowBlank    = false,
                MsgTarget     = MessageTarget.Side,
                DisplayField  = "Account",
                ValueField    = "Account",
                PageSize      = 100,
            };
            cboUsername.Store.Add(strUsername);
            cboUsername.ListConfig = new BoundList {
                Width        = 320,
                Height       = 300,
                ItemSelector = ".x-boundlist-item",
                Tpl          = new XTemplate {
                    Html = string.Format(@"
                    <Html>
					    <tpl for=""."">
						    <tpl if=""[xindex] == 1"">
							    <table class=""cbStates-list"">
								    <tr>
									<th style =""font-weight: bold;padding: 3px;background: #3892d3"">{0}</th> 
                                    <th style =""font-weight: bold;padding: 3px;background: #3892d3"">{1}</th>   
								    </tr>
						    </tpl>
						    <tr class=""x-boundlist-item"">
							    <td style=""padding:3px;"">{{{0}}}</td>    
                                <td style=""padding:3px;"">{{{1}}}</td> 
						    </tr>
						    <tpl if=""[xcount-xindex]==0"">
							    </table>
						    </tpl>
					    </tpl>
				    </Html>"                , "Account", "Fullname")
                }
            };
            cboUsername.Triggers.Add(new FieldTrigger {
                Icon = TriggerIcon.Clear, HideTrigger = true
            });
            #endregion Account

            #region Permission
            strPermission = new Store
            {
                ID    = "strPermission",
                Model =
                {
                    new Model              {
                        Fields =
                        {
                            new ModelField {
                                Name = "UID"
                            },
                            new ModelField {
                                Name = "Company"
                            },
                            new ModelField {
                                Name = "Username"
                            },
                            new ModelField {
                                Name = "Page"
                            },
                            new ModelField {
                                Name = "Action"
                            },
                            new ModelField {
                                Name = "Allow"
                            }
                        }
                    }
                }
            };
            grdPermission = new GridPanel
            {
                ID          = "grdPermission",
                BodyCls     = "line-body-border",
                CtCls       = "line-border",
                Title       = "Permissions List",
                Height      = 250,
                ColumnModel =
                {
                    Columns           =
                    {
                        new Column {
                            DataIndex = "UID",      Text = "UID",      Width    = 0
                        },
                        new Column {
                            DataIndex = "Company",  Text = "Company",  MinWidth = 100, Flex = 1
                        },
                        new Column {
                            DataIndex = "Username", Text = "Username", Width    = 100
                        },
                        new Column {
                            DataIndex = "Page",     Text = "Page",     Width    = 120
                        },
                        new Column {
                            DataIndex = "Action",   Text = "Action",   MinWidth = 150, Flex = 1
                        },
                        new Column {
                            DataIndex = "Allow",    Text = "Allow",    Width    = 100
                        },
                    }
                },
                BottomBar = { new PagingToolbar {
                                  HideRefresh = true
                              } },
                SelectionModel = { new RowSelectionModel {
                                       Mode = SelectionMode.Single
                                   } }
            };
            grdPermission.Store.Add(strPermission);
            #endregion Permission

            #region GLXAccount
            strGLXAccount = new Store
            {
                ID    = "strGLXAccount",
                Model =
                {
                    new Model              {
                        Fields =
                        {
                            new ModelField {
                                Name = "UID"
                            },
                            new ModelField {
                                Name = "Account"
                            },
                            new ModelField {
                                Name = "Company"
                            }
                        }
                    }
                }
            };
            grdGLXAccount = new GridPanel
            {
                ID          = "grdGLXAccount",
                BodyCls     = "line-body-border",
                CtCls       = "line-border",
                Title       = "Company List",
                Height      = 250,
                ColumnModel =
                {
                    Columns           =
                    {
                        new Column {
                            DataIndex = "UID",     Text = "UID",     Width = 0
                        },
                        new Column {
                            DataIndex = "Company", Text = "Company", Width = 100, Flex = 1
                        },
                    }
                },
                BottomBar = { new PagingToolbar {
                                  HideRefresh = true
                              } },
                SelectionModel = { new RowSelectionModel {
                                       Mode = SelectionMode.Single
                                   } }
            };
            grdGLXAccount.Store.Add(strGLXAccount);
            #endregion GLXAccount

            #region LocationAndAccount
            strLocationAndAccount = new Store
            {
                ID    = "strLocationAndAccount",
                Model =
                {
                    new Model              {
                        Fields =
                        {
                            new ModelField {
                                Name = "UID"
                            },
                            new ModelField {
                                Name = "Account"
                            },
                            new ModelField {
                                Name = "Location"
                            }
                        }
                    }
                }
            };
            grdLocationAndAccount = new GridPanel
            {
                ID          = "grdLocationAndAccount",
                BodyCls     = "line-body-border",
                CtCls       = "line-border",
                Title       = "Location List",
                Height      = 220,
                ColumnModel =
                {
                    Columns           =
                    {
                        new Column {
                            DataIndex = "UID",      Text = "UID",      Width = 0
                        },
                        new Column {
                            DataIndex = "Location", Text = "Location", Width = 100, Flex = 1
                        },
                    }
                },
                BottomBar = { new PagingToolbar {
                                  HideRefresh = true
                              } },
                SelectionModel = { new RowSelectionModel {
                                       Mode = SelectionMode.Single
                                   } }
            };
            grdLocationAndAccount.Store.Add(strLocationAndAccount);
            #endregion

            #region Worksheet
            strWorksheet = new Store
            {
                ID    = "strWorksheet",
                Model =
                {
                    new Model              {
                        Fields =
                        {
                            new ModelField {
                                Name = "UID"
                            },
                            new ModelField {
                                Name = "Worksheet Template Name"
                            },
                            new ModelField {
                                Name = "Name"
                            },
                            new ModelField {
                                Name = "Description"
                            },
                            new ModelField {
                                Name = "Template Type"
                            },
                            new ModelField {
                                Name = "Recurring"
                            },
                            new ModelField {
                                Name = "Company"
                            },
                            new ModelField {
                                Name = "Account"
                            },
                        }
                    }
                }
            };

            grdWorksheet = new GridPanel
            {
                ID          = "grdWorksheet",
                BodyCls     = "line-body-border",
                CtCls       = "line-border",
                Title       = "Worksheet List",
                Height      = 220,
                ColumnModel =
                {
                    Columns           =
                    {
                        new Column {
                            DataIndex = "UID",         Text = "UID",         Width = 0
                        },
                        new Column {
                            DataIndex = "Company",     Text = "Company",     Width = 150
                        },
                        new Column {
                            DataIndex = "Name",        Text = "Name",        Width = 100
                        },
                        new Column {
                            DataIndex = "Description", Text = "Description", Width = 120, Flex = 1
                        },
                        new Column {
                            DataIndex = "Account",     Text = "Account",     Width = 100
                        },
                    }
                },
                BottomBar = { new PagingToolbar {
                                  HideRefresh = true
                              } },
                SelectionModel = { new RowSelectionModel {
                                       Mode = SelectionMode.Single
                                   } }
            };
            grdWorksheet.Store.Add(strWorksheet);
            #endregion

            #region FormPanel
            frmHeader = new FormPanel
            {
                Collapsed   = false,
                Collapsible = true,
                Region      = Region.North,
                Layout      = "HBox",
                Items       =
                {
                    new FormPanel {
                        Layout             = "Anchor",
                        Flex               = 1,
                        BodyPaddingSummary = "10 10 10 10",
                        Border             = false,
                        Items              = { cboUsername }
                    },
                    new FormPanel {
                        Layout             = "Anchor",
                        Flex               = 1,
                        BodyPaddingSummary = "10 10 10 10",
                        Border             = false
                    }
                },
                TopBar =
                {
                    new Toolbar {
                        Items =
                        {
                            btnAddUser,
                            btnDelete
                        }
                    }
                }
            };

            frmGrid = new FormPanel
            {
                Layout             = "HBoxLayout",
                Region             = Region.Center,
                Header             = true,
                BodyPaddingSummary = "5,5,5,5",
                Items =
                {
                    new Panel         {
                        BodyPadding  = 5,
                        Layout       = "VBoxLayout",
                        Flex         = 2,
                        Region       = Region.Center,
                        LayoutConfig ={ new Ext.Net.VBoxLayoutConfig          {
                                            Align = VBoxAlign.Stretch
                                        } },
                        Items =
                        {
                            grdPermission, grdWorksheet
                        }
                    },
                    new Panel         {
                        BodyPaddingSummary = "5,5,5,5",
                        Layout             = "Fit",
                        Flex   = 1,
                        Region = Region.East,
                        Items  =
                        {
                            new Panel {
                                Items ={ grdGLXAccount, grdLocationAndAccount }
                            }
                        }
                    }
                }
            };
            #endregion FormPanel

            this.ID     = "pageMain";
            this.Layout = "BorderLayout";
            this.Items.AddRange(new ItemsCollection <Ext.Net.AbstractComponent> {
                frmGrid, frmHeader
            });
        }