click event handler for the table object.6. var target = e.tar get to get the clicked source object.7. oTr = $ (target). closest ('tr ') to obtain the latest tr ancestor element.8. f (oTr. index () = oTable. find ('tr '). last (). index () to check whether the last row is clicked.9. iNum ++, iNum value plus 1.10. eEle = oTr. clone () to clone the object of the current
Bootstrap table is lightweight and feature-rich data displayed in tabular form, supporting radio, check boxes, sorting, paging, show/Hide columns, fixed title scrolling table, responsive design, AJAX loading JSON data, click Sorted columns, card views, etc. Today, the use of bootstrap table's parent-child tables and row
first, the use of jquery control div display and hide
Using jquery to control the display and concealment of a div can be done in a word, for example:
1.$ ("#id"). Show () is Display:block,
$ ("#id"). Hide () is expressed as display:none;
2.$ ("#id"). Toggle () Toggles the visible state of the element. Switches to hidd
First, business needsSome users in the web system do not like paging, hoping that the data can be displayed in a single page.But there are scroll bars in the page, and when you look at the data below, you don't know which header column corresponds to the column in the data row.That is, there is no way to know what data this column is.So, I want the table title fixed, and the data row in the data too much wh
Click the table to obtain the table row or column index. The table obtains the column index.
See ASP. net mvc View:
This section of html will generate a table.Now we need to implement this. When you click a table, you can obtain the index of the
Preface: The day before yesterday just wrote a JS component bootstrap table table row Drag effect, today received new needs, need to be in the table row dragged on the basis of the can drag and drop the selected multiline. After a half-day study, the effect is out, but the f
is not hidden
This line needs to be hidden
This line needs to be hidden
...
You can directly use the explicit/hidden control function.
Var trs = $ ("tr [class = 'hid ']"); for (I = 0; I
That's simple. If you want to display it, change the corresponding method to show () or set the display attribute "".
Practical application:
Note: by default, only the row with the corresponding page name is displayed. Different r
Relationship between the visibility selector of JQuery and show and hide
The visibility selectors in JQuery refer to: selectors: hidden and: visible. In the previous article, we mentioned the difference between display and visibility. In this article, we will take a look at the elements selected by the visibility selector.
If the visible selector can select ou
Today, we're going to learn how to hide tables in a wps table. When it comes to hiding a table, it refers to the hidden cell data, which can be a single cell data being hidden, or it can be a whole row or a whole column of data being hidden. Let's take a look at the WPS. Two ways to
The most common way to hide a table column is as follows:
Copy Code code as follows:
Td.style.display = "None";
The efficiency of this approach is extremely low. For example, hiding a column of a thousand-row table, which takes about 4000 milliseconds to execute on my notebook (P4 M 1.4g,768m mem
, first of all, no matter how many dialog we just bound a click event handler, the performance has little impact, add a new dialog thinking two of the code is OK, still good, In this way, we can find that in the case of complex pages, the second idea is actually a better solution.These are all understood, and we can talk about the second protagonist of this article, the delegate method of jquery.
Delegate
First look at jq
To hide table columns, the most common method is as follows:
CopyCode The Code is as follows: TD. style. Display = "NONE ";
This method is extremely inefficient. For example, hiding a column in a table of thousands of rows takes about 1.4 milliseconds to execute on my notebook (P4 M 4000g, M memory), which is intolerable. For example, the following code:Copy co
First, the business needs and realize the effect
The project involves the order module, that day suddenly received a demand, said that the two different state of the order to achieve the effect of a single, page presentation is: About two table, the left table inside is the status of 1 orders, the right table inside is the status of 2 orders, Left
The visibility selector in jquery refers to: selectors: Hidden and: visible. In the previous article we mentioned the difference between display and visibility, and this article combines the visibility selector to see what kind of element the visibility selector is selected.If: The visible selector can select OutB, then $ ("#outB: Visible"). The value of size () 1;If: The hidden selector is able to select OutB, then $ ("#outB: Hidden"). The value of s
Click the last line to implement the table code for the row self-increment effect:Now any business is the pursuit of efficiency and humanization, of course, Web page effect is also the case, if a table can edit the data, edit to the last line, click can automatically add a row, this is a more humane effect, you can avo
article jquery delegate method.
DelegateFirst look at jquery's official syntax and description for delegate.
. Delegate (selector, EventType, Handler (EventObject))
Description:attach a handler to one or more events for all elements which match the selector, now or in the future, based On a specific set of root elements.
The delegate () method adds one or more event handlers for the specified element (the child elements of the selected element) a
The show in jquery and the Hide method usage are analyzed in this example. Share to everyone for your reference, specific as follows:
More interested readers of jquery-related content can view the site topics: "jquery window Operation tips Summary", "jquery drag an
Use jQuery to achieve full or invert selection, and click a row to change the background color. The specific code is as follows. If you are interested, refer to the following code. I hope to help you to release the CSS style first, in fact, this can be ignored directly.
The Code is as follows:
Body {margin: 0; padding: 0; font-size: 12px; font-family: ;}. Datagrid {width: 100% ;}. Required IRD tr th {bac
data.
After knowing the above three points, we will probably be clear. Traverse idsArray and match the primary key of the current row. If it matches, we will check it.
Note that the third step is to select a column value so that the column is displayed in the table. To hide the column value, you only need to hidden: true.
The above section describes the
In the page effect, sometimes weProgramThe ID attribute cannot be added to the looping column, because there may be multiple identical IDs in the list, so the jquery ID selector is not available. In this case, we can use the class selector,
At the same time, we may also need to limit the operations on this node element to the current Div (or table ).Code:
Doctype HTML public "-// W3C // dtd xhtml 1.0
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.