blob: 5c1f84896c9d8c0284362967216b87df0169f86a (
about) (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
var populationDataTable = (populationdata) => {
var lengthMenu = [10, 25, 50, 100, 1000];
if(populationdata.length > 1000) {
lengthMenu.push(populationdata.length)
}
$("#tbl-select-population").DataTable({
responsive: true,
lengthMenu: lengthMenu,
language: {
processing: "Processing… Please wait.",
loadingRecords: "Loading population — Please wait.",
lengthMenu: "Show _MENU_ populations",
info: "Showing _START_ to _END_ of _TOTAL_ populations"
},
data: populationdata,
columns: [
{
data: (apopulation) => {
return `<input type="radio" name="population_id"`
+ `id="rdo_population_id_${apopulation.InbredSetId}" `
+ `value="${apopulation.InbredSetId}" `
+ `class="chk-row-select">`;
}
},
{
data: (apopulation) => {
return `${apopulation.FullName} (${apopulation.InbredSetName})`;
}
}
]
});
};
$(() => {
dtAddCommonHandlers("#tbl-select-population");
populationDataTable(JSON.parse(
$("#tbl-select-population").attr("data-populations-list")));
});
|