Недавно я занялся разработкой веб-сайта, который использует таблицы данных. Сайт построен с использованием Laravel 4.
. Я новичок в datatables. Я хотел знать, возможно ли иметь загрузку данных, но не отображать какие-либо выходные данные / строки. Информация появится только после того, как пользователь заполнит строку поиска.
Я просмотрел некоторые доступные документы по таблицам данных. net, но не нашел того, что ищу.
РЕДАКТИРОВАТЬ: Вот фрагмент кода:
table.dataTable({
// Internationalisation. For more info refer to http://datatables.net/manual/i18n
"language": {
"aria": {
"sortAscending": ": activate to sort column ascending",
"sortDescending": ": activate to sort column descending"
},
"emptyTable": "No data available in table",
"info": "Showing1 _START_ to _END_ of _TOTAL_ entries1",
"infoEmpty": "No entries found",
"infoFiltered": "(filtered1 from _MAX_ total entries)",
"lengthMenu": "Show _MENU_ entries",
"search": "Search:",
"zeroRecords": "No matching records found"
},
// "bStateSave": true, // save datatable state(pagination, sort, etc) in cookie.
"columns": [{
"orderable": true
},{
"orderable": true
},{
"orderable": true
}, {
"orderable": false
}],
"lengthMenu": [
[5, 10, 20, 100, -1],
[5, 10, 20, 100, "All"] // change per page values here
],
// set the initial value
"pageLength": 10,
"pagingType": "bootstrap_full_number",
"language": {
"search": "Search Patient: ",
"lengthMenu": " _MENU_ records",
"paginate": {
"previous":"Prev",
"next": "Next",
"last": "Last",
"first": "First"
}
},
"columnDefs": [{ // set default column settings
'orderable': false,
'targets': [0]
}, {
"searchable": false,
"targets": [1]
}, { // set default column settings
'orderable': false,
"bVisible": false,
'targets': [4]
}],
"order": [
[4, "asc"]
] // set 5th column as a default sort by asc
});