Forums › Forums › Search & Filter Pro › How to set allowClear to true
- This topic has 4 replies, 2 voices, and was last updated 4 years, 7 months ago by
Trevor.
Viewing 5 posts - 1 through 5 (of 5 total)
-
Anonymous(Private) September 25, 2020 at 11:19 pm #260912
Hey guys,
I want to set all the boxes to allowClear true so that they get similar styling. I think it looks a lot cleaner this way. But it looks like there is something going on that is not allowing this to happen.
Here is the code I am trying. I have also tried to just add the data-attribute to the select element through jquery but it doesnt work either.
It will add the X’s to my boxes, but it will only clear the selections from the multibox. On the other boxes it throws a cannot ready property of undefined error.
I can leave a link to my dev site along with the UN/PW to get in in a private reply.
$.fn.select2.defaults.set( "allowClear", "true" ); $('select.sf-input-select').select2({ allowClear: "true" }); $(document).on('sf:ajaxfinish', '.searchandfilter', function() { $('select.sf-input-select').select2({ allowClear: "true" }); });
-
AuthorPosts
Viewing 5 posts - 1 through 5 (of 5 total)