The examples in this article describe the editable tables for jquery implementations. Share to everyone for your reference, specific as follows:
More interested readers of jquery-related content can view the site: "jquery table (
Function:
Click "cell selection" and use the direction key to change the selected cell. Press the Enter key or double-click the cell to enter the Editable State during the selection. When the cell loses focus, the modified content is saved.
Main Implementation ideas:The selection and moving of selected regions are implemented by jQuery's powerful API. The editable cell actually adds an input field to the c
A table that can be edited.
1. First write a page containing the table jqueryedit.html:
"Http://www.w3.org/TR/html4/loose.dtd" >
2. Write a JavaScript script file to complete the editable effect of the table, Jqueryedit.js:
in this file, when the input box after the change is submitted by the ENTER key, the following
jquery, an event parameter can be defined on the parameter function of a method of events, and jquery masks the browser's event differences and passes to us an available event object. There is a which property on this event object to get the key value of the keyboard key.CSS Code :TABLE{BORDER:1PX solid black;/* Fixed the border between the cells cannot be merge
I have met this in niuyun's news publishing system, but I didn't learn jquery or Javascript at the time. Here I create a new editable table: Click it to edit it, when you exit, the cell content is saved. you can press the Enter key to save the cell content and Press ESC to exit and save the cell content.
Front-End Interface:
HTML code:
CSS:
Body {}
contents of the current text boxvar NewText = Input_blur.val ();Td.html (NewText);});Responding to keyboard eventsInput.keyup (function (event) {Get key valuevar keyevent = Event | | window.event;var key = Keyevent.keycode;Get current Objectvar Input_blur = $ (this);Switch (key){Case 13://Press ENTER to save the contents of the current text boxvar NewText = Input_blur.val ();Td.html (NewText);Break
Case 27://Press ESC to cancel the change and change the text box to textTd.html (OldText
After several years of web development, it is essential to learn jquery. I improved some of the collected plug-ins, changed some to jquer, and integrated multiple plug-ins, it is also a summary of learning. A Brief Introduction to the jfixed table plug-in,
Function:
Fixed Columns
You can edit the table directly.
Use ajax to operate data
Use the tab key
The results we will eventually achieve are as follows:
When you click on the Learning Number column, you can edit it:
When you click ESC, the action is canceled, and when you click Enter, the modification takes effect (no interaction with the background)The page code is as follows (asp.net):
CSS (EIDTTABLE.CSS)
Table
{
border:1px solid black;
Border-collapse:collapse;
width:500px;
}
Function:Click "cell selection" and use the direction key to change the selected cell. Press the Enter key or double-click the cell to enter the Editable State during the selection. When the cell loses focus, the modified content is saved.Main Implementation ideas:The selection and moving of selected regions are implemented by jQuery's powerful API. The editable cell actually adds an input field to the cell
The new day begins and our life will continue. Today we want to share different tables with you. Common tables are used to display data. The tables to be shared today not only display data, you can also edit the data. When you click the data, the corresponding data grid becomes editable. To enter the topic today, first complete the HTML page:Copy codeThe Code is as follows: Right, now it is still a common table
A new day has begun, life will continue, today to share with you is not the same table, ordinary table for the display of data, the table to be shared today not only can display data, but also the data can be edited, when the mouse clicks on the data corresponding to the data grid becomes editable state, Nonsense not m
') , type : ' Select ', submit: ' OK '}); If you want to set a different style for the component, you can:$ ('. Editable '). Editable (' http://www.example.com/save.php ', { cssclass: ' SomeClass '}); $ ('. Editable ') . Editable (' http://www.example.com/save.php ', { loadurl: ' http://www.example.c
To implement editable table functions, we will address the following issues:
1. Identify the columns in the table where the data to be modified is found (how to find the cells);
2. How to make cells can be edited;
3. How to handle some key events in a cell;
4. Resolve Cross-browser issues.
We can work through jquery to
Today I learned how to use jQuery to edit a table. In this example, you can click a cell in the foreground table to modify the content. Press enter to save the modified content and esc to cancel the saved content. Principle: When you click a table cell on the client, add a text box to the cell, assign the original cont
: method to delete the data after successful, the corresponding row will be deleted}}, Options); Number of columns in the table var Colsnum = $ (this). Find (' tr '). Last (). Children (). Size (); 2. Initialize the Action column, default to the last column, from 1 for if (C.operatepos = =-1) {c.operatepos = colsNum-1; }//3. Get all rows that need to be manipulated var rows = $ (this). Find (' tr '); if (!c.handlefirst) {ro
Jquery-based code for editable drop-down boxes and jquery drop-down boxes
The principle is to add a ul simulated drop-down box to a textbox and use font to simulate a drop-down button.
I. create static results
First use css and html to make a proper look. Here these two fonts are used and can be created on the icomoon website. The advantage of using a font is tha
To implement the Editable table function, we need to solve the following problems:1. Identify the columns of the data to be modified in the table (how to find these cells );2. How to make cells editable;3. How to handle some cell button events;4. Solve cross-browser problems.We can solve the above problem step by step
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.