2017-09-11 13 views
1

jquery仮想キーボードのすべてで動作するdatatables.jsアプリケーションがあります。仮想キーボードを使用して生成された検索ボックスに情報を入力すると、フィルタリングされたコンテンツは機能しません。つまり、カラムがnamesで、仮想キーボードで名前(例:Airi)を検索すると、データテーブル内の情報は更新されません。私はそれを削除する場合は動作します。まずJQuery仮想キーボードとDatatables.js検索フィルタボックスがユーザー入力で更新されない

$(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(); 

}); 

私はpropertyChangeとしなければならなかったと思ったが、いくつかの変更後に、そうではないようだ:私はDataTableのために使用しています

コードは次のようです。問題はキーボード設定内のchangeプロパティ内にある可能性があります。

コンテンツはこのペンの内部に複製することができる。

https://codepen.io/AlecX4/pen/YrKYPv

任意のヒントや推奨事項が非常に高く評価されるだろう。

+1

へ:この上に立ち往生、誰のために...解決策は非常に簡単でした –

答えて

1

実際、私はそれを修正することができました。友人のために求めて

変更

   keyboard.$el.trigger('propertychange')   

   keyboard.$el.trigger('input')   
関連する問題