aboutsummaryrefslogtreecommitdiff
$(() => {
    var speciesDataTable = buildDataTable(
        "#tbl-select-species",
        JSON.parse(
            $("#tbl-select-species").attr("data-species-list")),
        [
            {
                data: (aspecies) => {
                    return `<input type="radio" name="species_id"`
                        + `id="rdo_species_id_${aspecies.SpeciesId}" `
                        + `value="${aspecies.SpeciesId}" class="chk-row-select">`;
                }
            },
            {
                data: (aspecies) => {
                    return `${aspecies.FullName} (${aspecies.SpeciesName})`;
                }
            }
        ],
        {
            select: "single",
            paging: true,
            scrollY: 700,
            deferRender: true,
            scroller: true,
            scrollCollapse: true,
            layout: {
                topStart: "info",
                topEnd: "search",
                bottomStart: "pageLength",
                bottomEnd: false
            }
        });
});