Discover jquery datatable column width fixed, include the articles, news, trends, analysis and practical advice about jquery datatable column width fixed on alibabacloud.com
JQuery creates a full-screen, fixed-width carousel image, and jquery full-screen
This is the first record left in the blog garden.
Html section
1 div class = "cm-banner"> 2
Css Section
1*{2 margin: 0; 3 padding: 0; 4} 5. cm-banner {6 width: 100%; 7 height: 300px; 8 overflow
the data returned by the server can be viewed in Console.log (JSON))In this method, you can determine whether the value returned by the server is active, then the class to control the display, the following to pay my way, I deleted a lot of my business logic code, so more intuitivedataTable: {"ajax": { "url": "", Type:' GET ', "dataType": ' JSON ' }, "initcomplete":function(settings, Json) {vardata =json.data; i
": "150px", "atargets": ["Guishudi"]},{"Swidth": "200px", "atargets": ["Haoma"]}],"Bprocessing": true,' Binfo ': false, ' Bdestroy ': true,"Fnrowcallback": Function (Nrow, Adata, Idisplayindex) {return nrow;}});
The problem is that I set the width of several columns
The code is as follows
Copy Code
aocolumndefs {"Swidth": "50px", "atargets": [0]},
and set the "Sscrollx": "98%", which cau
No matter how you sort the data when you query it with SQL, when the data is passed to the DataTable, it is sorted by its own rules, the rule is "order"You can use the following code to sort$ ('#example'). dataTable ({ "order": []});The Order property is sorted by default in ascending order of the first column, as follows:$ ('#example').
This article mainly introduces how to use jQuery to adjust the width of table columns by dragging the mouse. If you need it, you can adjust the width of table columns by dragging the mouse.
1. Import files:
The Code is as follows:
Lishui City automobile transportation Group Co., Ltd. Information Center min Anting
Aspxgridview is a commonly used third-party control, but there are not many client operations. In my work, I use the following method to obtain the column name and width through jquery. I hope it will help you:Function tools (){};// The gridid is the Client ID of aspxgridviewTools
();
}
};
Finally, when the mouse is bouncing, the final adjustment column width effect. Here I add the same MouseUp code to the body and th two elements. I thought I just need to add the MouseUp function to the body, but I do not understand why the mouse in the th, the event did not trigger, I had to give the th element also added code. The level is limited, the following completely duplicated code do
Similar to desktopProgramThe effect of dragging the table header. When you move the cursor over the header border, the mouse changes to the shape of dragging left and right, and then dragging the mouse, a vertical line is displayed in the table that moves with the mouse. When you open the mouse, the column width of the table is adjusted. I am idle recently, so I will try to implement it myself. Here I will
Like a table in a desktop program dragging a table header, when the mouse hovers over the header border line, the mouse becomes the shape that represents drag left and right, and then dragging the mouse, a vertical bar appears in the table and the mouse is finally released, and the table column width is adjusted. Recently more free, then try to achieve their own, here to share the small results.
First need
You can drag to adjust the width of a table column.
1. Import files:
Ii. TABLE
The above html is only used as a Demo and is not actually used in my project, and cannot be implemented during testing. Depressing...
3. Implement table dragging
During project usage, you do not need to introduce the store. js
And $ ("# myTable"). resizableColumns ();Required documents: http://download.csdn.net/detail/
Implement mouse to drag to adjust table column widthI. Introduction of documents:Second, TABLEThe above HTML is not actually used as a demo in my project, and in the testalso failed to achieve. Depressed ...Third, implement the table can be draggedfound no need to introduce store.js and $ ("#myTable"). Resizablecolumns (); Function can also be implementedRequired Documents: http://download.csdn.net/detail/itmyhome/7390263Extract two files separatelyJq
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 to switch between editable Columns
The fu
Implement mouse drag to resize table column width as shown:
I. Introduction of documents:
Copy Code code as follows:
Second, TABLE
Copy Code code as follows:
The above HTML is not actually used as a demo in my project, and it was not implemented during the test. Depressed...
Third, the implementation of the table can be dragged
Copy Code code as follo
Sometimes you want a table to have a slider when the content is out of the way, and you want some columns to stay stationary while you're sliding, here's a frozen column (fixed column) feature that uses jquery to dynamically modify the properties of columns:
The following jquery
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.