Reason: DataTables does not allow multiple initialization of a tableWorkaround: Set destroy:true at initialization time.But in a page of the modal box has more than one table, if the above solution, in the Closed modal box and then reopened, will be an error, and the number of tables are not fully displayedNormal Condition:Close and then click again to open:Error message: Failed to execute ' insertbefore ' ' node ': the node before which the new node
Online example http://datatables.club/example/plug-ins/api.html can only summarize the current page or all data, and cannot summarize search results data.The following is a summary of DataTables's own search results.Table.on ("Search.dt", Datasearch); // Summary Total amount function Datasearch () { var datas = table.data (); var total = 0; for (i = 0; i ) { + = parsefloat (datas[table.context[0). Aidisplay[i]]. Amount);
search is to set the parameters, and then destroy the DataTable to re-build aDatatable.fndestroy (false); DataTable= $ ("#datatable"). dataTable ($.datatablessettings); //Search after jump to the first page Datatable.fnpagechange (0);});Five, matters needing attention // when the window size changes, To solve the problem of not automatically adapting the DataTable header to $ (window). Resize (function () {dataTable datatable.fndraw ( In the success method of the removed Ajax need to w
[Cause]This should be a defect of the jquery. datatable control.The id of the checkbox plug-in this control is writable. Therefore, when multiple datatables are referenced to a page, all selected events match all datatable events, therefore, the checkbox of all multiple tables is selected.[Solution]Therefore, it is best to modify jquery. datatable control, assign different IDs to the checkbox under each generated datatable, because the datatable id is
function Dbclickdatatables (rows) {$ ("#@ (perfix) tbdata tbody tr"). DblClick (function (e) {Debugger;var index = $ (this). Context._dt_rowindex; Line number//var rows = $ (' #@ (perfix) Tbdata '). DataTable (). Data (). Rows (). (); var paramstring= '; for (i = 0; i jquery DataTables Double-click to get the line number.
Article Information "
"Ssearch": "Search"
Basic commands
Aasorting: The parameter is the array [[],[]] separately defines how each column is sorted
Aasortingfixed: Locking the sort of a column the user cannot change
Idisplaylength: Specify the number of displays per page
alengthmenu:[[two arrays to be the same],[really shows the contents of this array the last one is "all"]
Bautowidth: Automatically adjust column widths
Bdestroy: Like redeploying
Use DataRelation to establish relationships with multiple datatables and display them to TreeView and datarelation.
The DataRelation object performs two functions:
It makes the records related to the used records available. If it is in the parent record (GetChildRows), it provides the child record; if it is using the child record (GetParentRow), it provides the parent record.It can forcibly constrain the integrity of the reference, such as deleting t
JQuery DatatablesParameter Detail Description Data tables:http://datatables.net/ version:1.10.0 Examples of DOM descriptions:' Dom ':' , Defines the order in which the table controls appear in the page. Each control element has a single letter associated with it in the data table.
l-Controls that display the number of rows per page
f-The control that retrieves the condition
t-Tabular controls
i-Control of Table information summary
p-Pagination Control
r-Control in
In fact, if the paging does not require high performance, you can use
Dataadapter. Fill (INT startrecord, int maxrecords, Params datatable [] datatables) Method
The principle is while (0 {If (! Container1.read ()){Return 0;}Startrecord --;}Int num1 = 0;If (0 {While (num1 {If (this. _ hasfillerrorhandler){Try{Mapping. loaddatarowwithclear ();Num1 ++;}Catch (exception exception1){If (! ADP. iscatchableexceptiontype (exception1 )){Throw;}ADP. traceexcep
$ (' #example '). DataTable ({"Bpaginate": true,//whether paging is displayed"Blengthchange": true,//number of records displayed per row"Bfilter": true,//Search bar"Bsort": true,//whether the sort function is supported"Binfo": true,//display table information"Bautowidth": false,//adaptive width"Aasorting": [[1, "ASC"]],//Sort the list, the first parameter represents the array (starting from 0). 1 represents the browser column. The second parameter is DESC or ASC"Aocolumns": [NullNull{"Bvisible":
When using JQ DataTables, you want a column of data to be custom sorted, as follows: (for example, sort in Chinese and percent)
1: Define the Sort type:
Percentage sort
jquery.fn.datatableext.osort[' number-fate-asc ' = function (s1,s2) {
S1 = s1.replace ('% ', ');
S2 = s2.replace ('% ', ');
return s1-s2;
};
jquery.fn.datatableext.osort[' number-fate-desc ' = function (s1,s2) {
S1 = s1.replace ('% ', ');
S2 = s2.replace ('% ', ');
return s
can be passed over with another Ajax, here omitted directly written dead.Here is the background section
public class Datatableslazyload extends httpservlet{@Override protected void DoPost (HttpServletRequest request, Http
Servletresponse response) throws Servletexception, IOException {this.process (request, response);
/** * DataTables delay Load data loading, flag callout details to inject data, titles to inject title. * @param Request *
Baidu Editor (baidu. editor), Editor baidu. editor
The editor is usually used in some forums or blog websites. Now I will explain how to generate the editor using Jquery on the page.
1. Page code:
Introduce relevant JS files:
In the previous article, we introduced how to integrate Baidu editor Umeditor in Yii2 and how to solve the problem of umeditor uploading pictures.
Today we're going to talk about YII2 integration another powerful and easy-to-use Rich Text editor redactor, personally feel redactor than Baidu editor easy to use OH
Redactor has the official YII2 plug-in package, t
Author: White Wolf Source: http://www.manks.top/article/yii2_umeditor_upload This article copyright belongs to the author, welcome reprint, but without the author's consent must retain this paragraph statement, and in the article page obvious location gives the original text connection, Otherwise, the right to pursue legal liability is retained.
YII2 Framework integrated Baidu Editor, because the file upload is Yii2 bring the uploadedfile, it is inev
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.