Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/473.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/81.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript JQuery虚拟键盘和Datatables.js搜索筛选器框未在用户输入时更新_Javascript_Jquery_Html_Datatable_Keyboard - Fatal编程技术网

Javascript JQuery虚拟键盘和Datatables.js搜索筛选器框未在用户输入时更新

Javascript JQuery虚拟键盘和Datatables.js搜索筛选器框未在用户输入时更新,javascript,jquery,html,datatable,keyboard,Javascript,Jquery,Html,Datatable,Keyboard,我有一个datatables.js应用程序,可以在jquery虚拟键盘上运行。使用虚拟键盘在生成的搜索框中输入信息时,过滤的内容不起作用。这意味着,如果我有一个列names,并使用虚拟键盘搜索一个名称(例如Airi),则数据表中的信息不会得到更新。如果我移除它,它就会工作 我用于datatable的代码如下所示: $(document).ready(function(){ $('.selectpicker').selectpicker(); $('#example').DataTable

我有一个datatables.js应用程序,可以在jquery虚拟键盘上运行。使用虚拟键盘在生成的搜索框中输入信息时,过滤的内容不起作用。这意味着,如果我有一个列
names
,并使用虚拟键盘搜索一个名称(例如Airi),则数据表中的信息不会得到更新。如果我移除它,它就会工作

我用于datatable的代码如下所示:

$(document).ready(function(){
  $('.selectpicker').selectpicker();
  $('#example').DataTable();
  // example for the virtual keyboard on datatable search
  // this shows the keyboard but the content is not filtered
  function virtualKSearch() {    
        $('input[type="search"]').keyboard({
                layout: 'qwerty',
                draggable: true,
                position: {
                  of : $(window),
                  my : 'center bottom',
                  at : 'center bottom',
                  at2: 'center bottom'  
                },
                change: function(e, keyboard, el) {
                  keyboard.$el.val(keyboard.$preview.val())
                  keyboard.$el.trigger('propertychange')        
                },
                reposition: true
         }).addTyping();
      }
  // example for the bootstrap select keyboard, this works
  $('input[role="textbox"]').keyboard(
    {
      layout: 'qwerty',
      position: {
          of: $(window), 
          my: 'center bottom',
          at: 'center bottom',
          at2: 'center bottom'
      },
      change: function(e, keyboard, el) {
        keyboard.$el.val(keyboard.$preview.val())
        keyboard.$el.trigger('propertychange')        
      }
    })
    .addTyping();

  // datatable example
  virtualKSearch();

});
起初我认为这与
属性更改有关,但经过一些修改后,情况似乎并非如此。尽管我认为问题可能在键盘设置中的
change
属性中

可以在此笔内复制内容:


任何提示或建议都将不胜感激。

事实上,我设法解决了它。对于任何陷入这一困境的人来说……解决方案非常简单:

改变

              keyboard.$el.trigger('propertychange')        


找朋友
              keyboard.$el.trigger('input')