gpt4 book ai didi

javascript - 自动完成不起作用 - DataTables + Yadcf

转载 作者:行者123 更新时间:2023-11-27 22:54:02 27 4
gpt4 key购买 nike

我使用 DataTables 和 Yadcf 插件创建了一个表。它使用服务器端处理。我在第二列中添加了一个自动完成过滤器,并在服务器响应中添加了 yadcf_data_1 字段,但输入时没有任何反应。此外,JavaScript 控制台中没有任何错误。

你可以看到我的 table here .

    $(document).ready(function() {
table = $('#table').DataTable({
"processing": true,
"serverSide": true,
"ajax": {
"url": "server_processing.php",
"type": "POST"
},
"language": {
"url": "//cdn.datatables.net/plug-ins/1.10.11/i18n/Russian.json"
},
"searching": false,
dom: 'lfrtip<"#table_buttons"B>',
buttons: [
{
text: 'Экспорт в CSV',
action: function ( e, dt, node, config ) {
if(last_data) {
last_data['export'] = 1;
downloadFile("server_processing.php?" + $.param(last_data));
}
}
}
],
"columnDefs": [
{className: "center", "targets": [2, 3, 4, 5, 6, 7, 8]}
]
});

yadcf.init(table, [
{
column_number: 0,
filter_default_label: '--- Все ---'
},
{
column_number: 1,
filter_default_label: 'Введите',
filter_type: "auto_complete",
},
{
column_number: 2,
filter_type: "range_number",
filter_delay: 500,
filter_default_label: ['от', 'до']
},
{
column_number: 3,
filter_type: "range_number",
filter_delay: 500,
filter_default_label: ['от', 'до']
},
{
column_number: 4,
filter_type: "range_number",
filter_delay: 500,
filter_default_label: ['от', 'до']
},
{
column_number: 5,
filter_type: "range_number",
filter_delay: 500,
filter_default_label: ['от', 'до']
},
{
column_number: 6,
filter_type: "range_number",
filter_delay: 500,
filter_default_label: ['от', 'до']
},
{
column_number: 7,
filter_type: "range_number",
filter_delay: 500,
filter_default_label: ['от', 'до']
},
{
column_number: 8,
filter_type: "range_number",
filter_delay: 500,
filter_default_label: ['от', 'до']
},


]);

最佳答案

从初始化代码中删除 searching": false, 因为它会禁用表中的搜索功能

关于javascript - 自动完成不起作用 - DataTables + Yadcf,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37776791/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com