XmlTree label tree menu application example: B2C website Department management, xmltreeb2c

Source: Internet
Author: User

XmlTree label tree menu application example: B2C website Department management, xmltreeb2c

Light B2C e-commerce websitesDepartment (organization) management is a typical tree menu application instance.


The following describes the simple implementation process.

1. xml file for storing Department Information (Light B2C e-commerce websitesBase/dept. xml file in the base Directory)

<? Xml version = "1.0" encoding = "GBK"?> <D act = "base/xml/DShow.html" color = "red" weName = ""> <D act = "base/xml/DShow.html" color = "orange" weName = "customer group"> </D> <D color = "purple" weName = "Marketing Department"> </D> <D color = "blue" weName = "Service Department"> </D> <D color = "green" weName = ""> </D> <D color = "black" weName = ""> </D> <D color = "gray" weName = "Development Department"> </D>
2. Management of the main framework web page ( Light B2C e-commerce websitesBase/index.html file under the base Directory), with 60 rows. The function is to navigate to the tree menu.
<TD class = "m_out" onmouseup = 'this. className = "m_over" 'onmousedown = 'this. className = "m_down" 'onmouseover = 'this. className = "m_over" 'onmouseout = 'this. className = "m_out" 'nowrap> <NOBR>  <a class = M_Menu href =" javascript: void (0) "onClick =" lframe. location. href = '@ {sys: face} base/xml/tree.html? File = base/dept. xml & id = d & url = base/xml/deptShow.html '; data. location. href =' @ {sys: face} base/xml/deptShow.html? File = base/dept. xml & HtokID = d0'; openMe ('menu2 ') "id = Menu2> organization management </a> </NOBR> </TD
3. tree menu page ( Light B2C e-commerce websitesBase/xml/dept/tree.html files in the base/xml directory)
<Html> 4. Department Information Display page (
Light B2C e-commerce websitesBase/xml/dept/deptShow.html file in the base/xml directory)

<! -- User list --> <table width = "99%" cellpadding = "0" cellspacing = "0" border = "1" bordercolor = "# b4b4b4" align = center> <tr height = 24> <th> User Name </th> <th> name </th> <th> title </th> <th> mobile phone </th> </tr> <chtml> <! -- Length of each page --> <Bag id = pPage> <we name = length> 20 </we> </Bag> <! -- Take the total number and so on --> <esql module = base id = count> Select count (base_user.WE_ID) as all_ID, max (base_user.WE_ID) as max_id, min (base_user.WE_ID) as min_id from base_user, user_dept Where DEPT = '@ {pPage: HtokID}' and user_id = base_user.WE_ID </esql> <! -- Total number of pages and number of last pages --> <bag id = pPage> <we name = pages >@{ int :@{ count: all_id}/@ {pPage: length }}</we> <we name = odd >@{ int :@{ count: all_id }%@ {pPage: length }}</we> </bag> <if x = "@ {pPage: odd} "else = 1> <bag id = pPage x = 0> <we name = odd >@{ pPage: length} </we> </bag> <bag id = pPage> <we name = pages >@{ int :@{ pPage: pages} + 1 }</we> </bag> </if> <! -- Start page --> <if x = "@ {pPage: start}"> <Bag id = pPage> <we name = start >@{ int :@{ count: all_ID}-@ {pPage: odd }}</we> </Bag> </if> <! -- Remove the number of records that meet the condition but do not need to be displayed --> <esql module = base id = count1> Select count (base_user.WE_ID) as num from base_user, user_dept where base_user.we_id <'@ {int :@ {count: min_id} + @ {pPage: start}' and base_user.we_id >=' @ {count: min_id} 'and DEPT =' @ {pPage: HtokID} 'and user_id = base_user.WE_ID </esql> <! -- If the last page is insufficient, take the actual number of entries --> <if x = "@ {int: @ {pPage: start}/@ {pPage: length} + 1} "> <bag id = pPage x =" @ {pPage: pages} "> <we name = length >@{ pPage: odd} </we> </bag> </if> </chtml> <! -- Query data and display list --> <esql module = base id = list> select base_user.we_id, USERNAME, mobile, acl, cnname from base_user, (select temp_id, acl from (select base_user.we_id as temp_id, acl from base_user, user_dept where base_user.we_id >=' @ {int :@{ count: min_id} + @ {pPage: start} 'and base_user.we_id <=' @ {count: max_id} 'and DEPT =' @ {pPage: HtokID} 'and user_id = base_user.WE_ID order by temp_id limit @ {int: @ {pPage: start} + @ {pP Age: length}-@ {count1: num}) as t_id order by temp_id desc limit @ {pPage: length}) as t_wewhere temp_id = base_user.we_id </esql> <! -- Length of each page --> <Bag id = pPage> <we name = length> 20 </we> <we name = show_url >@{ sys: face} base/xml/userShow.html? HtokID =@{ pPage: HtokID} & WE_ID = </we> </Bag> <for objects = list start = "@ {list: getLength} "end =" 0 "> <we >@{ base/acl. xml: htokid =@{ list: ACL }}</we> <tr height = "22" class = bg0> <td> <a href = "@ {pPage: show_url }@{ list: WE_ID} ">@{ list: USERNAME} </a> </td> <a href =" @ {pPage: show_url }@{ list: WE_ID} ">@{ list: CNNAME} </a> </td> <a href =" @ {pPage: show_url }@{ list: WE_ID} ">@{ base/acl. xml: weName} </a> </td> <a href = "@ {pPage: show_url }@{ list: WE_ID}" >@{ list: MOBILE} </a> </td> </tr> </for> </chtml> </table>
Let's try it out first. Let's take a look at it and let's get a deeper look. Come on.
Download Easy Do IT resources

Platform and the latest development manual free download: http://download.csdn.net/detail/tx18/8464425

Development Instance:Light B2C e-commerce websites, Free download: http://download.csdn.net/detail/tx18/8318585

The light-Open Platform will occasionally upgrade to provide more powerful and Easy functions for you. Please note thatDownload the latest version


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.