django-ajax-datatable
django-ajax-datatable copied to clipboard
dont show column filters
Hello, in your demo has flters
in my example they don't show
model = Product
title = 'каталог'
initial_order = [["name", "asc"], ]
length_menu = [[10, 20, 50, 100, -1], [10, 20, 50, 100, 'all']]
search_values_separator = '+'
column_defs = [
{'name': 'sku', 'visible': True, 'title': 'Артикул'},
{'name': 'name', 'visible': True, 'placeholder': True, 'title': 'Название товара'},
{'name': 'brand', 'foreign_field': 'brand__name', 'visible': True,},
{'name': 'brand_id', 'visible': True,},
{'name': 'buttons', 'visible': True, 'placeholder': True, 'searchable': False, 'width': '300',
'orderable': False, 'title': ''}
]
....
<script language="javascript">
$(document).ready(function() {
AjaxDatatableViewUtils.initialize_table(
$('#datatable_product'),
"{% url 'ecom:ajax_datatable_ecom_product' %}",
{
// extra_options (example)
processing: false,
autoWidth: false,
full_row_select: false,
scrollX: false,
language: {
url: "/static/plugins/datatables/ru.json"
},
}, {
// extra_data
},
);
});
</script>