vedmack/yadcf

Pre Selecting an escaped value

adrianmihalko opened this issue · 5 comments

I am opening here a bug report, following my question on Stackoverflow.

The problem is, that it's currently not possible to populate select input at init:

67rfcw4e0m37

it's empty, but filtering works correctly.

As found by Datatables developer on their forum , maybe there is a race condition which is causing the YADCF plugin to clear the input value.

crgutxl7f456

As you can see it shows up for a sec, then it's become hidden.

I tried multiple solution, but none seem to be work:

$('#mytable').on( 'init.dt', function () {
     yadcf.exFilterColumn(oTable, [[4, '3/2020']], true);
  } );

 yadcf.initOnDtXhrComplete(function() { 
   yadcf.exFilterColumn(oTable, [[4, $("#yadcf-filter--mytable-4 option:eq(1)").val()]], true);
  });

Test site:

init.d
yadcf.initOnDtXhrComplete

@adrianmihalko please try the 0.9.4.beta.39 https://www.dropbox.com/s/g2ctbdq6zfuziy4/jquery.dataTables.yadcf.js?dl=0

update it on your site so I can see how it works for you

@vedmack Hi Daniel, looks good:

https://bow.thingiverse.ml

thanks for your time 👍

@adrianmihalko cool, can u please provide a test page for a scenario in which you try to pre-select a value that does not exist in the select, for example, 6/2020 (I want to see the flow...)?

@adrianmihalko you can get the final 0.9.4.beta.40 js version with the fix