alguien seria tan amable de ayudarme con un DataTable, necesito que me ordene la tabla de acuerdo a los checkbox seleccionados descendentemente, es decir que si selecciono un items se va valla mostrando de primero como muestra en el siguiente ejemplo. https://editor.datatables.net/examples/api/checkbox.html Cree los siguientes archivos: ---- index.php ----- <html> <head> <title>Ordenar por Columnas</title> <script type="text/javascript" src="https://code.jquery.com/jquery-1.12.3.js"></script> <script type="text/javascript" src="https://code.jquery.com/ui/1.11.4/jquery-ui.js"></script> <script type="text/javascript" src="https://cdn.datatables.net/1.10.12/js/jquery.dataTables.min.js"></script> <script type="text/javascript" src="https://cdn.datatables.net/buttons/1.2.1/js/dataTables.buttons.min.js"></script> <script type="text/javascript" src="https://cdn.datatables.net/select/1.2.0/js/dataTables.select.min.js"></script> <script type="text/javascript" src="https://editor.datatables.net/extensions/Editor/js/dataTables.editor.min.js"></script> <link rel="stylesheet" type="text/css" href="https://code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css"> <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.12/css/jquery.dataTables.min.css"> <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/buttons/1.2.1/css/buttons.dataTables.min.css"> <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/select/1.2.0/css/select.dataTables.min.css"> <link rel="stylesheet" type="text/css" href="https://editor.datatables.net/extensions/Editor/css/editor.dataTables.min.css"> </head> <body> <table class="display" id="example" width="100%" cellspacing="0" cellpadding="0" border="0"> <thead> <tr> <th>First name</th> <th>Last name</th> <th>Phone</th> <th>City</th> <th>Zip</th> <th>Active</th> </tr> </thead> </table> <!--Script--> <script type="text/javascript"> var editor; // use a global for the submit and return data rendering in the examples $(document).ready(function() { editor = new $.fn.dataTable.Editor( { "ajax": "../php/checkbox.php", "table": "#example", "fields": [ { label: "Active:", name: "active", type: "checkbox", separator: "|", options: [ { label: '', value: 1 } ] }, { label: "First name:", name: "first_name" }, { label: "Last name:", name: "last_name" }, { label: "Phone:", name: "phone" }, { label: "City:", name: "city" }, { label: "Zip:", name: "zip" } ] } ); $('#example').DataTable( { dom: "Bfrtip", ajax: "../php/checkbox.php", columns: [ { data: "first_name" }, { data: "last_name" }, { data: "phone" }, { data: "city" }, { data: "zip" }, { data: "active", render: function ( data, type, row ) { if ( type === 'display' ) { return '<input type="checkbox" class="editor-active">'; } return data; }, className: "dt-body-center" } ], select: { style: 'os', selector: 'td:not(:last-child)' // no row selection on last column }, buttons: [ { extend: "create", editor: editor }, { extend: "edit", editor: editor }, { extend: "remove", editor: editor } ], rowCallback: function ( row, data ) { // Set the checked state of the checkbox in the table $('input.editor-active', row).prop( 'checked', data.active == 1 ); } } ); $('#example').on( 'change', 'input.editor-active', function () { editor .edit( $(this).closest('tr'), false ) .set( 'active', $(this).prop( 'checked' ) ? 1 : 0 ) .submit(); } ); } ); </script> </body> </html> ---- checkbox.php ---- <?php { "data": [ { "DT_RowId": "row_1", "first_name": "Quynn", "last_name": "Contreras", "phone": "1-971-977-4681", "city": "Slidell", "zip": "81080", "active": "0" }, { "DT_RowId": "row_2", "first_name": "Kaitlin", "last_name": "Smith", "phone": "1-436-523-6103", "city": "Orlando", "zip": "U5G 7J3", "active": "1" }, { "DT_RowId": "row_3", "first_name": "Cruz", "last_name": "Reynolds", "phone": "1-776-102-6352", "city": "Lynn", "zip": "EJ89 9DQ", "active": "0" }, { "DT_RowId": "row_4", "first_name": "Sophia", "last_name": "Morris", "phone": "1-463-224-1405", "city": "Belleville", "zip": "T1F 2X1", "active": "0" }, { "DT_RowId": "row_5", "first_name": "Kamal", "last_name": "Roberson", "phone": "1-134-408-5227", "city": "Rehoboth Beach", "zip": "V7I 6T5", "active": "1" }, { "DT_RowId": "row_6", "first_name": "Dustin", "last_name": "Rosa", "phone": "1-875-919-3188", "city": "Jersey City", "zip": "E4 8ZE", "active": "0" }, { "DT_RowId": "row_7", "first_name": "Xantha", "last_name": "George", "phone": "1-106-884-4754", "city": "Billings", "zip": "Y2I 6J7", "active": "0" }, { "DT_RowId": "row_8", "first_name": "Bryar", "last_name": "Long", "phone": "1-918-114-8083", "city": "San Bernardino", "zip": "82983", "active": "0" }, { "DT_RowId": "row_9", "first_name": "Kuame", "last_name": "Wynn", "phone": "1-101-692-4039", "city": "Truth or Consequences", "zip": "21290", "active": "1" }, { "DT_RowId": "row_10", "first_name": "Indigo", "last_name": "Brennan", "phone": "1-756-756-8161", "city": "Moline", "zip": "NO8 3UY", "active": "1" }, { "DT_RowId": "row_11", "first_name": "Avram", "last_name": "Allison", "phone": "1-751-507-2640", "city": "Rancho Palos Verdes", "zip": "I7Q 8H4", "active": "0" }, { "DT_RowId": "row_12", "first_name": "Martha", "last_name": "Burgess", "phone": "1-971-722-1203", "city": "Toledo", "zip": "Q5R 9HI", "active": "1" }, { "DT_RowId": "row_13", "first_name": "Lael", "last_name": "Kim", "phone": "1-626-697-2194", "city": "Lake Charles", "zip": "34209", "active": "1" }, { "DT_RowId": "row_14", "first_name": "Lyle", "last_name": "Lewis", "phone": "1-231-793-3520", "city": "Simi Valley", "zip": "H9B 2H4", "active": "0" }, { "DT_RowId": "row_15", "first_name": "Veronica", "last_name": "Marks", "phone": "1-750-981-6759", "city": "Glens Falls", "zip": "E3C 5D1", "active": "1" }, { "DT_RowId": "row_16", "first_name": "Wynne", "last_name": "Ruiz", "phone": "1-983-744-5362", "city": "Branson", "zip": "L9E 6E2", "active": "0" }, { "DT_RowId": "row_17", "first_name": "Jessica", "last_name": "Bryan", "phone": "1-949-932-6772", "city": "Boulder City", "zip": "F5P 6NU", "active": "0" }, { "DT_RowId": "row_18", "first_name": "Quinlan", "last_name": "Hyde", "phone": "1-625-664-6072", "city": "Sheridan", "zip": "Y8A 1LQ", "active": "1" }, { "DT_RowId": "row_19", "first_name": "Mona", "last_name": "Terry", "phone": "1-443-179-7343", "city": "Juneau", "zip": "G62 1OF", "active": "0" }, { "DT_RowId": "row_20", "first_name": "Medge", "last_name": "Patterson", "phone": "1-636-979-0497", "city": "Texarkana", "zip": "I5U 6E0", "active": "1" }, { "DT_RowId": "row_21", "first_name": "Perry", "last_name": "Gamble", "phone": "1-440-976-9560", "city": "Arcadia", "zip": "98923", "active": "1" }, { "DT_RowId": "row_22", "first_name": "Pandora", "last_name": "Armstrong", "phone": "1-197-431-4390", "city": "Glendora", "zip": "34124", "active": "0" }, { "DT_RowId": "row_23", "first_name": "Pandora", "last_name": "Briggs", "phone": "1-278-288-9221", "city": "Oneida", "zip": "T9M 4H9", "active": "1" }, { "DT_RowId": "row_24", "first_name": "Maris", "last_name": "Leblanc", "phone": "1-936-114-2921", "city": "Cohoes", "zip": "V1H 6Z7", "active": "1" }, { "DT_RowId": "row_25", "first_name": "Ishmael", "last_name": "Crosby", "phone": "1-307-243-2684", "city": "Midwest City", "zip": "T6 8PS", "active": "0" }, { "DT_RowId": "row_26", "first_name": "Quintessa", "last_name": "Pickett", "phone": "1-801-122-7471", "city": "North Tonawanda", "zip": "09166", "active": "1" }, { "DT_RowId": "row_27", "first_name": "Ifeoma", "last_name": "Mays", "phone": "1-103-883-0962", "city": "Parkersburg", "zip": "87377", "active": "0" }, { "DT_RowId": "row_28", "first_name": "Basia", "last_name": "Harrell", "phone": "1-528-238-4178", "city": "Cody", "zip": "LJ54 1IU", "active": "1" }, { "DT_RowId": "row_29", "first_name": "Hamilton", "last_name": "Blackburn", "phone": "1-676-857-1423", "city": "Delta Junction", "zip": "X5 9HE", "active": "0" }, { "DT_RowId": "row_30", "first_name": "Dexter", "last_name": "Burton", "phone": "1-275-332-8186", "city": "Gainesville", "zip": "65914", "active": "1" }, { "DT_RowId": "row_31", "first_name": "Quinn", "last_name": "Mccall", "phone": "1-808-916-4497", "city": "Fallon", "zip": "X4 8UB", "active": "0" }, { "DT_RowId": "row_32", "first_name": "Alexa", "last_name": "Wilder", "phone": "1-727-307-1997", "city": "Johnson City", "zip": "16765", "active": "0" }, { "DT_RowId": "row_33", "first_name": "Rhonda", "last_name": "Harrell", "phone": "1-934-906-6474", "city": "Minnetonka", "zip": "I2R 1H2", "active": "1" }, { "DT_RowId": "row_34", "first_name": "Jocelyn", "last_name": "England", "phone": "1-826-860-7773", "city": "Chico", "zip": "71102", "active": "1" }, { "DT_RowId": "row_35", "first_name": "Vincent", "last_name": "Banks", "phone": "1-225-418-0941", "city": "Palo Alto", "zip": "03281", "active": "0" }, { "DT_RowId": "row_36", "first_name": "Stewart", "last_name": "Chan", "phone": "1-781-793-2340", "city": "Grand Forks", "zip": "L1U 3ED", "active": "1" } ], "options": [], "files": [] } ?> hago el ejemplo que me indican alli pero no me funciona, que debo hacer?