|
1321 | 1321 | orderCellsTop: true, |
1322 | 1322 | columns: [ |
1323 | 1323 | { |
| 1324 | + "name": "index", |
1324 | 1325 | "type": "text", |
1325 | 1326 | "visible": false, |
1326 | 1327 | "render": function(data, type, row, meta) { |
1327 | 1328 | return row.index + ''; |
1328 | 1329 | } |
1329 | 1330 | }, |
1330 | 1331 | { |
| 1332 | + "name": "remove", |
1331 | 1333 | "orderable": false, |
1332 | 1334 | "className": "dt-center cm-center", |
1333 | 1335 | "render": function(data, type, row, meta) { |
1334 | 1336 | return '<i class="fa fa-remove fa-fw clickable action-remove" alt="Remove" title="Remove"></i>'; |
1335 | 1337 | } |
1336 | 1338 | }, |
1337 | 1339 | { |
| 1340 | + "name": "name", |
1338 | 1341 | "type": "text", |
1339 | 1342 | "render": { |
1340 | 1343 | "display": (data, type, row, meta) => { |
|
1349 | 1352 | } |
1350 | 1353 | }, |
1351 | 1354 | { |
| 1355 | + "name": "review", |
1352 | 1356 | "type": "text", |
1353 | 1357 | "render": function(data, type, row, meta) { |
1354 | 1358 | return row.reviewPercentage + "%"; |
1355 | 1359 | } |
1356 | 1360 | }, |
1357 | 1361 | { |
| 1362 | + "name": "selected", |
1358 | 1363 | "render": function(data, type, row, meta) { |
1359 | 1364 | return createCheckbox('selected', row.skeleton); |
1360 | 1365 | } |
1361 | 1366 | }, |
1362 | 1367 | { |
| 1368 | + "name": "pre_visible", |
1363 | 1369 | "orderable": false, |
1364 | 1370 | "visible": this.showVisibilityControls, |
1365 | 1371 | "render": function(data, type, row, meta) { |
1366 | 1372 | return createCheckbox('pre_visible', row.skeleton); |
1367 | 1373 | } |
1368 | 1374 | }, |
1369 | 1375 | { |
| 1376 | + "name": "post_visible", |
1370 | 1377 | "orderable": false, |
1371 | 1378 | "visible": this.showVisibilityControls, |
1372 | 1379 | "render": function(data, type, row, meta) { |
1373 | 1380 | return createCheckbox('post_visible', row.skeleton); |
1374 | 1381 | } |
1375 | 1382 | }, |
1376 | 1383 | { |
| 1384 | + "name": "desmo_visible", |
1377 | 1385 | "orderable": false, |
1378 | 1386 | "visible": this.showVisibilityControls, |
1379 | 1387 | "render": function(data, type, row, meta) { |
1380 | 1388 | return createCheckbox('desmosome_visible', row.skeleton); |
1381 | 1389 | } |
1382 | 1390 | }, |
1383 | 1391 | { |
| 1392 | + "name": "mito_visible", |
1384 | 1393 | "orderable": false, |
1385 | 1394 | "visible": this.showVisibilityControls, |
1386 | 1395 | "render": function(data, type, row, meta) { |
1387 | 1396 | return createCheckbox('mitochondrion_visible', row.skeleton); |
1388 | 1397 | } |
1389 | 1398 | }, |
1390 | 1399 | { |
| 1400 | + "name": "text_visible", |
1391 | 1401 | "orderable": false, |
1392 | 1402 | "visible": this.showVisibilityControls, |
1393 | 1403 | "render": function(data, type, row, meta) { |
1394 | 1404 | return createCheckbox('text_visible', row.skeleton); |
1395 | 1405 | } |
1396 | 1406 | }, |
1397 | 1407 | { |
| 1408 | + "name": "meta_visible", |
1398 | 1409 | "orderable": false, |
1399 | 1410 | "visible": this.showVisibilityControls, |
1400 | 1411 | "render": function(data, type, row, meta) { |
1401 | 1412 | return createCheckbox('meta_visible', row.skeleton); |
1402 | 1413 | } |
1403 | 1414 | }, |
1404 | 1415 | { |
| 1416 | + "name": "color", |
1405 | 1417 | "type": "hslcolor", |
1406 | 1418 | "className": "dt-center cm-center", |
1407 | 1419 | "render": { |
|
1418 | 1430 | } |
1419 | 1431 | }, |
1420 | 1432 | { |
| 1433 | + "name": "actions", |
1421 | 1434 | "orderable": false, |
1422 | 1435 | "render": function(data, type, row, meta) { |
1423 | 1436 | return '<i class="fa fa-tag fa-fw clickable action-annotate" ' + |
|
1635 | 1648 | * Re-apply current order to skeleton list. |
1636 | 1649 | */ |
1637 | 1650 | SelectionTable.prototype.reapplyOrder = function() { |
1638 | | - var col = this.order[0][0]; |
| 1651 | + const columnIndex = this.order[0][0]; |
| 1652 | + const column = this.gui.datatable.settings().init().columns[columnIndex].name; |
1639 | 1653 | var desc = 'desc' === this.order[0][1]; |
1640 | 1654 |
|
1641 | 1655 | // Use only first level sort |
1642 | | - if (2 === col) { // Name |
| 1656 | + if ('name' === column) { |
1643 | 1657 | this.sortByName(desc); |
1644 | | - } else if (3 === col) { // Review |
| 1658 | + } else if ('review' === column) { |
1645 | 1659 | this.sortByReview(desc); |
1646 | | - } else if (4 === col) { // Selected |
| 1660 | + } else if ('selected' === column) { |
1647 | 1661 | this.sortBySelected(desc); |
1648 | | - } else if (10 === col) { // Color |
| 1662 | + } else if ('color' === column) { |
1649 | 1663 | this.sortByColor(desc); |
1650 | 1664 | } |
1651 | 1665 | }; |
|
0 commit comments