7:
All the code in default. JS is placed in a functiononready (){}
.
This is actually a fineui Convention. fineui will find whether the onready function exists after extjs and its own scripts are executed. If so, execute this function. You can enable debugmode in Web. config, observe the generated page source code, and finally you will see the script:
Occupies the Panel-autosizepanelid attribute of the entire page
This is an attribute that you will never miss. If you want a panel, window, tree, tabstrip, regionpanel, or form to occupy the entire page space, you need to use this attribute, let's take a look at the sample site:
Make the ASP. Net Control also participate in fineui's Ajax sending-ajaxaspnetcontrols attribute
As we mentioned in the first article, one design concept of fineui is to "implement 80% functions with great care". That is to say, some tasks that cannot be completed by the controls provided by fineui will surely be encountered. What should we do? We have to turn to ASP. NET controls, and fineui provides an elegant way to allow ASP. NET controls to also participate in the Ajax re-sending process, which is the ajaxaspnetcontrols attribute.
If you want an ASP. NET to be updated during page sending, you can put its ID in the ajaxaspnetcontrols attribute. Multiple Control IDs are separated by commas. For more information, see the example Page.
So how does fineui achieve this?
The truth is actually very simple. fineui will look for the ASP in the generated HTML fragments in the Ajax response. net Control, get ASP. net generate HTML and update scripts. If you use debugging tools such as firebug to view Ajax requests, you can clearly see the following interaction process:
If you can understand how fineui works, try this example. This example mainly describes the differences between the label and literal controls of ASP. NET in the Ajax interaction process of fineui. Let's take a look at the Code:
1: <ext:PageManager ID="PageManager1" AjaxAspnetControls="Label1,Literal1" runat="server" />
2: <asp:Label ID="Label1" Text="Label1" runat="server"></asp:Label>
3: <br />
4: <asp:Literal ID="Literal1" Text="Literal1" runat="server"></asp:Literal>
5: <br />
6: <Ext: button id = "button1" runat = "server" text = "update the preceding text values" onclick = "button#click">
7: </ext:Button>
1: protected void Button1_Click(object sender, EventArgs e)
2: {
3: Label1.Text = "Label1 - " + DateTime.Now.ToLongTimeString();
4: Literal1.Text = "Literal1 - " + DateTime.Now.ToLongTimeString();
5: }
If you only read this code, we may assume that ASP: Label and ASP: literal are updated when you click the button, but the actual situation is not like this:
Why is it worth updating only label1, while literal1 is not updated? Look at the generated HTML source code and think about the internal processing process of fineui. It is not hard to find out the mysteries.
Generated HTML source code:
1: <span id="Label1">Label1</span>
2: <br />
3: Literal1
4: <br />
5: <div id="Button1_wrapper"></div>
The format of HTML code generated by ASP: Label and ASP: literal is different. The HTML code generated by ASP: literal does not have an external <span> tag, no wonder fineui cannot use the id value to search for literal and update its HTML value. What should I do?
In this special case, fineui does not intend to make literal and label Behavior consistent, but provides a simple solution (nesting a layer of SPAN or Div label outside literal ):
Is it fun ......
Summary
Each page requires a pagemanager control, which provides page-level parameter configuration and can be used to overwrite the configuration in Web. config. However, the autosizepanelid attribute is most often used to extend the panel to the entire page.
In the next article, we will introduce the most commonly used button controls. fineui provides a rich array of functions for buttons.
Note: The articles in the "fineui Secret Garden" series were originally published on sanshenshi, And the blog garden was first launched. Please indicate the source for reprinting. Document Catalog official forum