0

First of all, thanks a lot for amazing plugin! I have Datatable with server-side processing. When I choose one option from dropdown, I got 2 selected options: one I choose, and another empty. I mean I got this:

<ul class="select2-selection__rendered">
  <li class="select2-selection__choice" title=""></li>
  <li class="select2-selection__choice" title="option1"></li>
  <li class="select2-search select2-search--inline"></li>
</ul>

It makes wrong SQL query (in LIKE operator I got something like '|option1'). I can get correct query with php script, but it won't remove empty selected option from header of my table.

Would be appreciated for any help.

1 Answers1

0

You are welcome,

Looks like you using a multi select filter on some column, and thats why yadcf sends strings with | (OR) to your server.

On your server side you have to do the split of the string into array/list of string and construct a proper sql query.

Split in Java

Split in PHP(see code sample in bottom

p.s I'm the author of yadcf

Community
  • 1
  • 1
Daniel
  • 36,833
  • 10
  • 119
  • 200
  • Daniel, thanks for quick response. Yes, I understand that, and I solved problem with query (I remove first "|" character from string, and construct correct query). But empty selected option still appears inside the header of the table. I mean, when I select one option from the list, yadcf adds also empty selected option. – Y. Ushakov Sep 30 '15 at 11:05
  • If you have a link to the issue with the empty selection please post / send to me so I can look at it – Daniel Sep 30 '15 at 11:26
  • At the moment I work on local machine, but I'll try to post my table on web hosting. Thanks again for great job with yadcf and for your help! – Y. Ushakov Sep 30 '15 at 11:41