Jquery-based high-performance switching between td and input and modifiable content implementation code

Source: Internet
Author: User

Add the left and right direction keys.

In actual work, we will encounter such a situation. The page displays 100 pieces of data, and the user also wants to change the data. The common method may be as follows,

 

This method may cause a problem, that is, the page is displayed slowly, and if there is a scroll bar, there will be some cards. The following shows a solution for me. The display is all td and there is no input tag, as shown below:

When you click one of the td, the following will appear:

When you click td, a dynamic input is added to td and the td value is assigned to input. When you move the mouse away from input, the input value is assigned to td. At the same time, you can press enter to move up or down.

You can make some extensions and make some practical functions (for editing large volumes of data, etc ). I will not talk about it much. I will attach the source code for your reference only.
Online Demo address http://demo.jb51.net/js/td_input_edit/index.htm
Packaging http://xiazai.jb51.net/201101/yuanma/td_input_edit.rar

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.