aboutsummaryrefslogtreecommitdiff
path: root/uploader/templates/phenotypes
diff options
context:
space:
mode:
Diffstat (limited to 'uploader/templates/phenotypes')
-rw-r--r--uploader/templates/phenotypes/view-dataset.html38
1 files changed, 25 insertions, 13 deletions
diff --git a/uploader/templates/phenotypes/view-dataset.html b/uploader/templates/phenotypes/view-dataset.html
index 38a4d11..f171483 100644
--- a/uploader/templates/phenotypes/view-dataset.html
+++ b/uploader/templates/phenotypes/view-dataset.html
@@ -96,17 +96,10 @@
dtAddCommonHandlers("#tbl-phenotypes-list");
var data = {{phenotypes | tojson}};
- $("#tbl-phenotypes-list").DataTable({
- responsive: true,
- lengthMenu: [10, 25, 50, 100, 1000, data.length],
- language: {
- processing: "Processing results… Please wait.",
- loadingRecord: "Loading phenotypes — Please wait.",
- info: "_START_ to _END_ of _TOTAL_ phenotypes",
- lengthMenu: "Show _MENU_ phenotypes",
- },
- data: data,
- columns: [
+ var dtPhenotypesList = buildDataTable(
+ "#tbl-phenotypes-list",
+ data,
+ [
{
data: function(pheno) {
return `<input type="checkbox" name="selected-phenotypes" `
@@ -117,7 +110,7 @@
},
{data: "sequence_number"},
{
- data: function(pheno) {
+ data: function(pheno, type, set, meta) {
var spcs_id = {{species.SpeciesId}};
var pop_id = {{population.Id}};
var dtst_id = {{dataset.Id}};
@@ -137,7 +130,26 @@
pheno.Pre_publication_description);
}
}
- ]
+ ],
+ {
+ // select: true, // extension is causing trouble.
+ rowId: function(pheno) {
+ return `${pheno.InbredSetCode}_${pheno.xref_id}`;
+ }
+ });
+
+ $("#btn-phenotypes-list-select-all").on("click", (event) => {
+ dtPhenotypesList.rows().select();
+ dtPhenotypesList.rows().nodes().each((node, idx) => {
+ $(node).find(".chk-row-select").prop("checked", true);
+ });
+ });
+
+ $("#btn-phenotypes-list-deselect-all").on("click", (event) => {
+ dtPhenotypesList.rows().deselect();
+ dtPhenotypesList.rows().nodes().each((node, idx) => {
+ $(node).find(".chk-row-select").prop("checked", false);
+ });
});
});
</script>