javascript - JQuery Virtual Keyboard and Datatables.js search filter box not updating on user input -
i have datatables.js application works allongside jquery virtual keyboard. when using virtual keyboard enter information generated search box, filtered content not work. meaning if have column names
, search name(e.g airi) virtual keyboard, information inside datatables not updated. if remove it works.
the code using datatable following:
$(document).ready(function(){ $('.selectpicker').selectpicker(); $('#example').datatable(); // example virtual keyboard on datatable search // shows keyboard content not filtered function virtualksearch() { $('input[type="search"]').keyboard({ layout: 'qwerty', draggable: true, position: { of : $(window), : 'center bottom', @ : 'center bottom', at2: 'center bottom' }, change: function(e, keyboard, el) { keyboard.$el.val(keyboard.$preview.val()) keyboard.$el.trigger('propertychange') }, reposition: true }).addtyping(); } // example bootstrap select keyboard, 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(); });
at first thought had propertychange
after modification seems not case. although believe issue might inside of change
property inside keyboard setting.
the content can replicated inside pen:
https://codepen.io/alecx4/pen/yrkypv
any tips or recommendations appreciated.
actually, managed fix it. gets stuck on this...the solution quite simple:
change
keyboard.$el.trigger('propertychange')
to
keyboard.$el.trigger('input')
Comments
Post a Comment