Learn Extjs5 with me (28--adding modules and menu definitions [1 database and tables])

Source: Internet
Author: User

Learn Extjs5 with me (28--adding modules and menu definitions [1 database and tables])below we begin to enter the design of the custom system and the construction of the various components. first set up the database in SQL Server, where the name of the data I defined as EXTJS5, and then need to establish a module definition table, this table will be stored in the system of all the module definition information. In order to have an intuitive front and rear interaction, the module and the menu of the two parts added, you can organize the menu data sent to the front desk to display.
because of the many modules in the system, need to classify, so first to design a "module grouping" table, for the menu is the same, you need a "menu grouping" of the table.
  • Module Grouping table: _modulegroup
  • Module table: _module
  • Menu Grouping table: _menugroup
  • Menu Definition table for module: _menumodule
First, the database in the building table
the relationship between the four tables is as follows:
The following is the statement that builds the table:
CREATE TABLE [dbo]. [_modulegroup] ([tf_modulegroupid] [nvarchar] (Ten) COLLATE chinese_prc_ci_as not null,[tf_title] [nvarchar] (a) COLLATE chinese_prc_ci _as not null,[tf_description] [nvarchar] (a) COLLATE chinese_prc_ci_as null,[tf_iconurl] [nvarchar] (a) COLLATE Chinese _prc_ci_as Null,[tf_remark] [nvarchar] (max) COLLATE chinese_prc_ci_as NULL, CONSTRAINT [pk___modulegroup__08ea5793] PRIMARY KEY CLUSTERED ([tf_modulegroupid] ASC) with (Ignore_dup_key = OFF) on [PRIMARY], CONSTRAINT [_modulegroup_ix1] UNIQ UE nonclustered ([Tf_title] ASC) with (Ignore_dup_key = OFF) on [PRIMARY]) on [PRIMARY]

CREATE TABLE [dbo]. [_module] ([Tf_moduleid] [nvarchar] (Ten) COLLATE chinese_prc_ci_as not null,[tf_modulegroupid] [nvarchar] (Ten) COLLATE CHINESE_PRC _ci_as not null,[tf_modulename] [nvarchar] (a) COLLATE chinese_prc_ci_as not null,[tf_title] [nvarchar] (COLLATE) Chinese_prc_ci_as not null,[tf_description] [nvarchar] (a) COLLATE chinese_prc_ci_as null,[tf_requestmapping] [ NVARCHAR] (COLLATE chinese_prc_ci_as not null,[tf_iconurl] [nvarchar] (a) COLLATE chinese_prc_ci_as null,[tf_ ShortName] [nvarchar] (COLLATE chinese_prc_ci_as null,[tf_englishname] [nvarchar] (a) COLLATE chinese_prc_ci_as Null,[tf_tablename] [nvarchar] (COLLATE chinese_prc_ci_as null,[tf_primarykey] [nvarchar] (a) COLLATE chinese_prc_ Ci_as not null,[tf_namefields] [nvarchar] (a) COLLATE chinese_prc_ci_as not NULL,[TF_TITLETPL] [nvarchar] (COLLATE) Chinese_prc_ci_as Null,[tf_codefield] [nvarchar] (a) COLLATE chinese_prc_ci_as Null,[tf_orderfield] [nvarchar] (50) COLLATE chinese_prc_ci_as Null,[tf_datefield] [NVArchar] (COLLATE chinese_prc_ci_as null,[tf_yearfield] [nvarchar] (a) COLLATE chinese_prc_ci_as null,[tf_ Monthfield] [nvarchar] (COLLATE chinese_prc_ci_as null,[tf_seasonfield] [nvarchar] (a) COLLATE chinese_prc_ci_as Null,[tf_filefield] [nvarchar] (COLLATE chinese_prc_ci_as null,[tf_homepagetag] [int] null,[tf_isenable] [bit] not NULL,[TF_HASBROWSE] [bit] not null,[tf_hasinsert] [bit] not null,[tf_hasedit] [bit] not null,[tf_hasdelete] [bit] not NULL , [tf_hasexec] [bit] not null,[tf_hasauditing] [bit] not null,[tf_hasapprove] [bit] not null,[tf_haspayment] [bit] not NULL , [tf_hasaddition] [bit] not null,[tf_isinlineoper] [bit] NULL CONSTRAINT [df___module__tf_isin__1ed998b2] DEFAULT ((0)) , [tf_allowinsertexcel] [bit] not null,[tf_alloweditexcel] [bit] not null,[tf_defaultorderfield] [nvarchar] (COLLATE) Chinese_prc_ci_as null,[tf_codelevel] [nvarchar] (a) COLLATE chinese_prc_ci_as null,[tf_linkedmodule] [nvarchar] (200 ) COLLATE chinese_prc_ci_as Null,[tf_haschart] [bit] not NULl,[tf_canlimit] [bit] not null,[tf_issystem] [bit] not null,[tf_searchcondorder] [int] null,[tf_remark] [nvarchar] (max ) COLLATE chinese_prc_ci_as NULL, CONSTRAINT [pk___module__1bfd2c07] PRIMARY KEY CLUSTERED ([Tf_moduleid] ASC) with (Ignor E_dup_key = OFF) on [PRIMARY], CONSTRAINT [_module_ix1] UNIQUE nonclustered ([Tf_modulename] ASC) with (Ignore_dup_key = of  F) on [PRIMARY], CONSTRAINT [_module_ix2] UNIQUE nonclustered ([Tf_title] ASC) with (Ignore_dup_key = OFF) on [PRIMARY]) on [PRIMARY] Gouse [Extjs5]goalter TABLE [dbo].  [_module] With CHECK ADD CONSTRAINT [_MODULE_FK1] FOREIGN KEY ([tf_modulegroupid]) REFERENCES [dbo]. [_modulegroup] ([Tf_modulegroupid]) On UPDATE CASCADE



CREATE TABLE [dbo]. [_menugroup] ([tf_menugroupid] [nvarchar] (Ten) COLLATE chinese_prc_ci_as not null,[tf_title] [nvarchar] (a) COLLATE chinese_prc_ci_ As not null,[tf_description] [nvarchar] (a) COLLATE chinese_prc_ci_as null,[tf_glyph] [nvarchar] (Ten) COLLATE Chinese_ Prc_ci_as null,[tf_iconurl] [nvarchar] (a) COLLATE chinese_prc_ci_as null,[tf_remark] [nvarchar] (max) COLLATE Chinese_ Prc_ci_as Null,[tf_expand] [bit] NULL, CONSTRAINT [pk___menugroup__1920bf5c] PRIMARY KEY CLUSTERED ([Tf_menugroupid] ASC ) with (Ignore_dup_key = OFF) on [PRIMARY], CONSTRAINT [_menugroup_ix1] UNIQUE nonclustered ([Tf_title] ASC) with (Ignore_du P_key = OFF) on [PRIMARY]) on [PRIMARY]

create TABLE [dbo]. [_menumodule] ([Tf_menumoduleid] [int] not null,[tf_menugroupid] [nvarchar] (Ten) COLLATE chinese_prc_ci_as not Null,[tf_moduleid] [ NVARCHAR] (Ten) COLLATE chinese_prc_ci_as not null,[tf_orderid] [int] null,[tf_addseparator] [bit] null,[tf_parentmenu] [ NVARCHAR] (COLLATE chinese_prc_ci_as null,[tf_title] [nvarchar] (a) COLLATE chinese_prc_ci_as null,[tf_ Parentfilter] [nvarchar] (max) COLLATE chinese_prc_ci_as NULL, CONSTRAINT [pk___menumodule__2c3393d0] PRIMARY KEY CLUSTERED ([Tf_menumoduleid] ASC) with (Ignore_dup_key = OFF) on [PRIMARY]) on [Primary]gouse [Extjs5]goalter TABLE] [dbo].[ _menumodule] with CHECK ADD CONSTRAINT [_MENUMODULE_FK1] FOREIGN KEY ([tf_menugroupid]) REFERENCES [dbo]. [_menugroup] ([Tf_menugroupid]) On UPDATE cascadegoalter TABLE [dbo].  [_menumodule] With CHECK ADD CONSTRAINT [_MENUMODULE_FK2] FOREIGN KEY ([Tf_moduleid]) REFERENCES [dbo]. [_module] ([Tf_moduleid]) On UPDATE CASCADE 

add some data after creating the table:









The database and source code will be available for download at the end of a phase.

Learn Extjs5 with me (28--adding modules and menu definitions [1 database and tables])

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.