{% spaceless %}
<select style="" class="row_select" id="{{ datatable.table_id }}-dt-length">
    <option value="10">10 Rows</option>
    <option value="25">25 Rows</option>
    <option value="50">50 Rows</option>
    <option value="100">100 Rows</option>
</select>

<script>
    var plugin = {
        init: function (table, state_data) {
            $('#{{ datatable.table_id }}-dt-length').val(table.table.api().page.len())
            $('#{{ datatable.table_id }}-dt-length').change(function (select) {
                table.table.api().page.len($(this).val())
                table.table.api().draw()
            })
        },
    }
    django_datatables.add_plugin('{{ datatable.table_id }}', plugin)
</script>
{% endspaceless %}