Quick Development Platform: big wet teach me to write programs (3) Automatic completion (no spring for silk), quick development platform

Source: Internet
Author: User

[Switch] Quick Development Platform: big wet teach me to write programs (3) Auto-completion (no spring silk), quick development platform

I. Goddess also loves to play the QR code

"Are you, kiss ."

"On! In! Yes, what's the matter? "(I woke up! Covet goddess for a long time! High school students, senior one confessed to her, "I want to find more than 170". When I was a sophomore, I grew to 170 and "I want to find a 175 ", I bought a pair of high and low blood costs and increased the "I like more than 178, have a sense of security ")

Three minutes later ....

"You can find me if you're okay." Why is my TM so disappointing? I didn't swear to give her a word when she took the initiative to speak to me: Roll!

"There is a Web page that won't do it. Can you help people with it ."

"Well, it must be done for you ."

"Necrotic, I sent it to you offline. It depends on you ."

"Well, by me, It's right to rely on me"

The QQ avatar is black again...

The requirement is okay. I just wrote a purchase order entry interface.

The ticket will be sent offline after 20 minutes.

"Hey, come on. Let me see if there is any problem. Please try again if there is any problem"

Ii. Heavy wet AV tour(For more information about AV, see the previous blog "Teach me to write a program (2) the path to AV".)

"Dear, there are two other small issues. suppliers on the header of the purchase order entry interface should be able to automatically complete the Purchase Order. The user experience will be much better and the customer will feel very user-friendly. I marked the requirements for that stuff. It may be a bit difficult. "

"This is not a thing for me. It is wrapped on me ."

This item seems to have been used before and automatically completed. The ajaxcontroltoolkit contains the CascadingDropDown control.

REFERENCE The ajaxcontroltoolkit, pull a CascadingDropDown, and associate it with the text box. Then write a webservice, which provides a method for it to call. OK.

It seems wrong. There are two columns in the drop-down box requested by the goddess. One is the encoding column and the other is the name column. Only one column can be displayed. Unable to meet the requirements. I checked the attributes again.

"Dayong"

"Big Wet"

"Dead"

"The network speed is a little slow. I will limit the port number of the quickplay ."

"What are you doing? What's the problem? I just want to cultivate your sentiment ..."

"Well, you need to see how this drop-down box works ."

"I still haven't learned so much about AV Technology in teaching videos. It's a typical AV technology application ."

"I know the AV Technology. I know how to capture the visit background data with ajax. The key is how to present it at the front-end? "

"You can remember every word that Mr. Cang taught in a foreign language clearly. I just taught you how to dynamically load menus last week. (For details, see" Teach me big wet. net general permission framework (1) menu navigation) Isn't it about how to dynamically construct html?

The front-end is actually very simple, no matter how beautiful the interface is, it is made up of the most basic html elements ."

"Well, you have to write it yourself for half a day. Roll it out"

After talking about this, I already have a general idea.

1. capture data from the background

10 records are returned based on the conditions passed in from the front-end for display on the interface.

/// <Summary> /// auto-completion (10 rows are displayed) /// </summary> /// <param name = "where"> condition </param> /// <param name = "param"> parameterization </param>/ // <returns> </returns> public DataTable autocomplete (StringBuilder where, sqlParam [] param) {StringBuilder strSql = new StringBuilder (); strSql. append ("select top 10 Supplier_ID, Code, ShortName, ValueAddRate FROM Base_Supplier WHERE 1 = 1"); strSql. append ("AND DeleteMark = 0 AND IsVisible = 0"); strSql. append (where); strSql. append ("order by CreateDate"); return DataFactory. sqlDataBase (). getDataTableBySQL (strSql, param );}

2. dynamically splice the content to be displayed

The drop-down auto-fill box is indeed composed of tables and characters, as is the case with big wet.

In the previous blog, I have discussed how ajax calls the background method, so I will not repeat it here.

After capturing supplier data, perform a traversal and loop stitching <tr>

<Td> content </td>

..............

</Tr>

After splicing, it is loaded into the div according to the position of the Supplier_Name control.

When the selected content is selected, the selected content is written to the Supplier_Name control.

Hide div when Supplier_Name loses focus.

// Supplier auto-completion function SupplierAutocomplete () {$ ("# Supplier_Name"). bind ("keyup", function (e) {if (e. which! = 13 & e. which! = 40 & e. which! = 38) {var parm = "action = autocomplete & search =" + escape ($ (this ). val (); Load_Supplier (parm );}}). focus (function () {var parm = "action = autocomplete & search =" + escape ($ (this ). val (); Load_Supplier (parm); $ (this ). select () ;}); function Load_Supplier (parm) {getAjax ('.. /.. /WMSBase/SysSupplier/Supplier_List.aspx ', parm, function (data) {var json = eval ("(" + data + ")"); var html = ""; for (var I = 0; I <json. JSON. length; I ++) {var list = json. JSON [I]; html + = "<tr>"; html + = '<td>
// Automatically complete the table var IndetableRow_autocomplete = 0; var scrollTopheight = 0; function autocomplete (Objkey, width, height, data, callBack) {if ($ ('#' + Objkey ). attr ('readonly') = 'readonly') {return false;} if ($ ('#' + Objkey ). attr ('Disabled ') = 'Disabled') {return false;} IndetableRow_autocomplete = 0; scrollTopheight = 0; var X = $ ("#" + Objkey ). offset (). top; var Y = $ ("#" + Objkey ). offset (). left; $ ("# div_gridshow" cmd.html (""); if ($ ("# div_gridshow "). attr ("id") = undefined) {$ ('body '). append ('<div id = "div_gridshow">

I can't believe it after writing it. Now I can write such a large JS Code. This is the power of the goddess.

The sister is too careless. Suppliers need to complete the game automatically, and purchasers need to complete the game automatically.
The implementation of functions in the form of JS Code helps you understand the principle. In fact, this type of public code can be completely encapsulated into controls, so you don't have to look at this disgusting thing.

Run the command...

It's unreasonable. It's still not automatically completed.

"Big hero, it cannot be displayed !"

"I wiped it and wrote all the functions. You didn't call it. How can it be displayed. Just like you are a girl, you have evil thoughts and methods, but you can use them for specific objects. Certainly there will be no gains. That is YY"

Okay, let me change it.

// Initialize $ (function () {divresize_From (50); SupplierAutocomplete (); SalesmanAutocomplete ();})

Run again

The numbers and names can be included.

Sent again.

"Daxiong, the more I write JavaScript, the more I find that js is actually very similar to C #. Isn't the initialization here equivalent to Page_Load in C #? When we enter the page, execute the following content first ."
"Yes, you will find that almost all languages are connected later. Just like all women, you can warm your back, give birth to a baby, and search for your private money ."

3. No spring

"Sorry, I forgot to tell you that the material name in the following table should also be filled in by drop-down. "

"This person won't be able to make it clear at one time, and VS is off. Isn't that a joke for me ?"

"2B, it's obvious that it's too difficult to tease you ."

"Yeah, although it's poor, I'm handsome. Although handsome, I can't take the ATM machine as a card brush. It's also comfortable to watch. It's special for all kinds of endocrine disorders and various gynecological problems. Have a vision ."

"Wipe, you still take it seriously ."

"Don't tell you, I will use my heart to serve the Goddess ."

The principle is the same. Only different data is captured. 5 minutes later.

Let's help her change the style of the navigation page. We need to make a full set of services. Who makes me a service department.

 

"Hey, you have all done. You can check it out ."

Three minutes later...

"It's just amazing. What I want is this effect. My wife has taken a bath. I thanked you for it, brother !"

Wipe! Who TM said silk also has spring... The Goddess in the hard disk is the spring of silk.

I would like to share this document with cainiao like me.

Demo URL:

Http://www.learun.cn powersoft Official Website

Http://www.learun.cn: 8080 Online demo

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.