Usage of DWZ in APS. NET WebForm (2), dwzwebform

Source: Internet
Author: User

Usage of DWZ in APS. NET WebForm (2), dwzwebform

Because my personal understanding of any framework is not in place or the framework's own limitations, you may encounter some problems in project implementation. Below I will introduce several problems in the development process of DWZ. This article also makes sense if it helps you.

1. tree menu display problems

The built-in tree control of DWZ is good for menu display, but it is too limited to display tree menus with a large number of layers and a large amount of data. Here we recommend a js plug-in: zTree. The reason why zTree is important is that it contains rich APIs and excellent Ajax capabilities. You don't need to worry about its learning costs, examples are also rich.

Interested friends can visit the official website: http://www.ztree.me/v3/main.php#_zTreeInfo

Note that you only need to reference the 2 files shown in 1.1. There may be other js and css files in the demo to better display the demo, which does not need to be referenced (It is also found that it will conflict with the current framework during reference ).

(Fig. 1.1)

2. Interface Height Problems

During the development process, you will certainly encounter this problem: the self-built interface does not fully occupy the entire screen, set the div to a fixed height, and change the display of different specifications will have problems. LayoutH can solve this problem.

What exactly does it mean? As shown in figure 2.1, the parent element of B is 600px, And the layoutH of B is 100, then the height of B is 500px. In fact, the height of B is the height of the parent element-layoutH.

 

(Fig. 2.1)

3. list display problems

The list is an important part of the background management interface. The addition, deletion, and modification functions provided by the Framework are also quite complete, but some problems still occur in actual development.

I prefer the front-end js scripts to directly output to the interface to form html to display the page. However, it is found that the dynamically generated interface does not show the desired effect. Why? The debug tool found that after html is generated, dwz will automatically load and re-assemble it. The html generated by the js front-end, dwz cannot predict when it will be triggered, and interface rewriting will be powerless. Later, I checked the dwz js source code. Several functions made me feel lost. $ ("table. table ", $ (P )). jTable (); initUI ($ (p); you may have guessed it from the English meaning of the function, after html is saved, any of the above functions will be re-loaded.

So what is the difference between jTable and initUI? After testing, we found that jTable is a lightweight function that only works for table Styles. InitUI will reload all styles. It is worth noting that initUI can load the entire page without parameters. Of course, this is not recommended. Generally, you can fill in the div you want to load, which can avoid the problem of inconsistency of the entire interface style or the loading time is too long. In the table, we often put the checkbox in the first column for batch operation. Note that initUI is required, and jTable does not include this function.

4. drop-down menu

I found that it did not work when I manipulated the form to display a certain item during ajax asynchronous operations. Later I debugged it repeatedly and found that this problem can be solved during ajax synchronization. However, the reason is unclear. If you have any idea, please leave a message later. Thank you very much.

5. Close the current modal box

The function is simple: $. pdialog. closeCurrent (); you can call it when you need to disable it.

Why do I need to talk about this problem? The pop-up modal box is usually used to add or modify data. How can we refresh the data on the parent page after the modal box is closed? As we mentioned in the previous article, dwz dynamically loads the page to the div. In other words, although the modal box shows another interface, it is the content of the div in the aspect of dwz. That is to say, the modal box can directly call the function of the parent page. Here, the parent page is a bit inaccurate, because they are actually in the same page. Back to the topic, we need to refresh the page to actually call the data Initialization Method of the parent page.

This is very convenient, but it also brings trouble. If there are many project interfaces and methods can access each other, the same naming method may lead to incredible results. Therefore, we recommend that you add a page function description after each function. For example, you can write the data method as initData4AddUser () when adding the user interface ();

 

 

 



The above are some of my personal experiences. Of course, in use, there will also be various problems that I cannot cover.

The demo sample will not be put on. If you need a friend, please leave a message later.

If you have any disadvantages, you are welcome to make an axe.

 

 

 

 

 


APSNET40 is just getting started. Every time you create a new web application and open defaultapsx, there will always be

You have set a master page. form has a selection option on the new Web form panel on the master page, removing the check box for the master page!

In apsnet, how does one not trigger verification on the page when clicking a server control?

Set the CausesValidation of this control to "false ".

Related Article

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.