I read an article todayArticleIs to introduce the Sorting Problem in JQ. It is used in a plug-in tablesorter. JS, more abundant words will also use jquery-latest.js and jquery. tablesorter. Pager. js.
The statement used is as follows:
JavaScript code Copy content to clipboard
- $ (Document). Ready (Function(){
- $ ("# Mytable"). Tablesorter ({sortlist: [[0, 0], [1, 0]});
- }
- )
I cannot quite understand it. I checked the sortlist parameter, but there was no result. Later, I found the answer under the guidance of a eldest brother:
The sorting list is [0, 0] [1, 0], in ascending order of the first and second columns, and [column index, sorting direction] 0 ASC (ascending) 1 DESC (descending ).
There are also some other parameters:
Part 1
The second column is not allowed. Sorting is performed for each three columns.
JavaScript code Copy content to clipboard
-
- $ (Document). Ready (Function(){
-
- $ ("Mytable"). Tablesorter ({
-
- // Pass the headers argument and assing A Object
-
- Headers :{
-
- // Assign the secound column (we start counting zero)
-
- 1 :{
- // Disable it by setting the property sorter to false
-
- Sorter:False},
-
- // Assign the third column (we start counting zero)
-
- 2 :{
-
- // Disable it by setting the property sorter to false
-
- Sorter:False}
-
- }
-
- });
-
- });
Use th to be more like a button
JavaScript code Copy content to clipboard
- $ (Document). Ready (Function(){
- $ ("# Mytable"). Tablesorter (
- {Cancelselection:True}
- );
- });
After a column is ordered, it cannot be moved. Other columns are sorted by this column.
JavaScript code Copy content to clipboard
- $ (Document). Ready (Function(){
- // Call the tablesorter plugin \
- $ ("Mytable"). Tablesorter ({
- // Set forced sort on the fourth column and I decending order.
- Sortforce: [[0, 0]}
- );
- });
Button replacement
JavaScript code Copy content to clipboard
- $ (Document). Ready (Function(){
- // Call the tablesorter plugin
- $ ("Table"). Tablesorter ({
- // Change the multi sort key from the default shift to alt button
- Sortmultisortkey:'Altkey'
- });
- });
By the way, we can find some other UI plug-ins:
Ui. draggable. Ext. js
Usage: After a file is loaded, you can drag the layer of class = "Block"
JavaScript code Copy content to clipboard
- $ (Document). Ready (Function(){
- $ (". Block"). draggable ();
- });
Draggable (options) can be followed by many options
Option Description: http://docs.jquery.com/UI/Draggables/draggable#options
Option instance: http://dev.jquery.com/view/trunk/plugins/ui/tests/draggable.html
Droppables:
Required file, drag drop
Ui. Mouse. js
Ui. draggable. js
Ui. draggable. Ext. js
Ui. droppable. js
Ui. droppable. Ext. js
Usage:
JavaScript code copy the content to the clipboard
- $ (document ). ready ( function () {
- $ (". Block"). draggable ({helper: 'clone '});
- $ (". Drop"). droppable ({
- Accept: ". Block",
- activeclass: 'droppable-active',
- hoverclass: 'droppable-Hover ',
- drop: function (EV, UI) {
- $ ( This ). append ("
dropped !");
- }
- });
- });
Option Description: http://docs.jquery.com/UI/Droppables/droppable#options
Option instance: http://dev.jquery.com/view/trunk/plugins/ui/tests/droppable.html
Sortables sorting:
Required file
Jquery. dimensions. js
Ui. Mouse. js
Ui. draggable. js
Ui. droppable. js
Ui. sortable. js
Usage:
JavaScript code Copy content to clipboard
- $ (Document). Ready (Function(){
- $ ("# Mylist"). sortable ({});
- });
Dimensions document http://jquery.com/plugins/project/dimensions
Option Description: http://docs.jquery.com/UI/Sortables/sortable#options
Option instance: http://dev.jquery.com/view/trunk/plugins/ui/demos/ui.sortable.html
Select selectables:
Required file
Jquery. dimensions. js
Ui. Mouse. js
Ui. draggable. js
Ui. droppable. js
Ui. selectable. js
Usage:
JavaScript code Copy content to clipboard
- $ (Document). Ready (Function(){
- $ ("# Mylist"). selectable ();
- });
Option Description: http://docs.jquery.com/UI/Selectables/selectable#options
Option instance: http://dev.jquery.com/view/trunk/plugins/ui/tests/selectable.html
Resizables:
Required file. In this example, several CSS files are required.
Jquery. dimensions. js
Ui. Mouse. js
Ui. resizable. js
Usage:
JavaScript code Copy content to clipboard
- $ (Document). Ready (Function(){
- $ ("# Example"). resizable ();
- });
CSS file: http://dev.jquery.com/view/trunk/themes/flora/flora.all.css
Option Description: http://docs.jquery.com/UI/Resizables/resizable#options
Option instance: http://dev.jquery.com/view/trunk... S/ui.resizable.html
Part 2: Interaction Effect:
Accordion fold menu:
Required files:
Ui. Accordion. js
Jquery. dimensions. js
Usage:
JavaScript code Copy content to clipboard
- $ (Document). Ready (Function(){
- $ ("# Example"). Accordion ();
- });
CSS file: http://dev.jquery.com/view/trunk/themes/flora/flora.all.css
Option Description: http://docs.jquery.com/UI/Accordion/accordion#options
Option instance: http://dev.jquery.com/view/trunk/plugins/accordion? P = 1.1.1
Dialogs dialog box:
Required files:
Jquery. dimensions. js
Ui. Dialog. js
Ui. resizable. js
Ui. Mouse. js
Ui. draggable. js
Usage:
JavaScript code Copy content to clipboard
- $ (Document). Ready (Function(){
- $ ("# Example"). Dialog ();
- });
CSS file: http://dev.jquery.com/view/trunk/themes/flora/flora.all.css
Option Description: http://docs.jquery.com/UI/Dialog/dialog#options
Option instance: http://dev.jquery.com/view/trunk/plugins/ui/tests/dialog.html
Scyclers slide:
Required file
Jquery. dimensions. js
Ui. Mouse. js
Ui. Slider. js
Usage:
JavaScript code Copy content to clipboard
- $ (Document). Ready (Function(){
- $ ("# Example"). Slider ();
- });
CSS file: http://dev.jquery.com/view/trunk/themes/flora/flora.all.css
Option Description: http://docs.jquery.com/UI/Slider/slider#options
Option instance: http://dev.jquery.com/view/trunk/plugins/ui/demos/ui.slider.html
Tablesorter table sorting:
Required file
Ui. tablesorter. js
Usage:
JavaScript code Copy content to clipboard
- $ (Document). Ready (Function(){
- $ ("# Example"). tablesorter ({sortlist: [[0, 0], [2, 1], Widgets :['Zebra']});
- });
CSS file: http://dev.jquery.com/view/trunk/themes/flora/flora.all.css
Option Description: http://docs.jquery.com/Plugins/Tablesorter/tablesorter#options
Option instance: http://tablesorter.com/docs/#Demo
Tabs tab (not very good for IE support ):
Required file
Ui. Tabs. js
Usage:
JavaScript code Copy content to clipboard
- $ (Document). Ready (Function(){
- $ ("# Example> ul"). tabs ();
- });
CSS file: http://dev.jquery.com/view/trunk/themes/flora/flora.all.css
Option Description: http://docs.jquery.com/UI/Tabs/tabs#initialoptions
Option instance: http://dev.jquery.com/view/trunk/plugins/ui/tests/tabs.html
Tabs ext http://stilbuero.de/jquery/tabs_3/rotate.html
Part 3: effect:
Shadow shadow
Http://dev.jquery.com/view/trunk/plugins/ui/demos/ui.shadow.html
Magnifier Amplification
Http://dev.jquery.com/view/trunk/plugins/ui/demos/ui.magnifier.html