I have dynamic columns in w2grid column, In such column we have add date picker and select2. Date picker and select2 initialize in visible column but not initialize when horizontal scrolling. And when i horizontal scrolling to last column my all initialize datepicker and selct2 not working and they are not working. Please help me.
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
Check every second either it is initialize or not.
<script>
setInterval(function(){
if($('class_name').hasClass("select2-hidden-accessible")) {
} else {
$("class_name").select2();
}
}, 2000);
</script>