Open dlennin opened 10 years ago
Can you:
Thanks!
The script I use is:
$(document).ready(function() {
$('#sector').multiSelect({
selectableOptgroup: true,
selectableHeader: "<input type='text' size='15px' class='search-input' autocomplete='on' placeholder='try \"12\"'>",
selectionHeader: "<input type='text' class='search-input' autocomplete='on' placeholder='try \"4\"'>",
afterInit: function(ms){
var that = this,
$selectableSearch = that.$selectableUl.prev(),
$selectionSearch = that.$selectionUl.prev(),
selectableSearchString = '#'+that.$container.attr('id')+'.ms-optgroup-label:not(.ms-selected), .ms-elem-selectable:not(.ms-selected)',
selectionSearchString = '#'+that.$container.attr('id')+' .ms-elem-selection.ms-selected';
that.qs1 = $selectableSearch.quicksearch(selectableSearchString)
.on('keydown', function(e){
if (e.which === 40){
that.$selectableUl.focus();
return false;
}
});
that.qs2 = $selectionSearch.quicksearch(selectionSearchString)
.on('keydown', function(e){
if (e.which == 40){
that.$selectionUl.focus();
return false;
}
});
},afterSelect: function(){
this.qs1.cache();
this.qs2.cache();
},
afterDeselect: function(){
this.qs1.cache();
this.qs2.cache();
}
});
});
this is my html code:
This is the image that is built multiselect, a search is done but I need to also look in the optgroup and there but you hide matches, currently the library is prepared to do searches the options of a select but when coupled with a multiselect optgroups and is where the search options do not work anymore, I want to see how to solve it.
I hope you can help me with my problem as me it is urgent, thank you for your support.
Ok but did you tried Step 1 ?
Try the lastest version here https://github.com/DeuxHuitHuit/quicksearch This repo (https://github.com/riklomas/quicksearch) is not maintain anymore (see #67)
And by reading your code, I do not think you are not using it the right way... Can you reproduce it on jsbin/jsfiddle ?
I'm using the component like this:
in section searchable, contains only one that I need and put options as in the image oprtgroups
I think you should ask them why their demo does not work: https://github.com/lou/multi-select
I was not aware that the thing existed.
But, again, please answer this question:
Did you tried with the lastest version of the quicksearch plugin here https://github.com/DeuxHuitHuit/quicksearch ?
the latest version of quicksearch and am taking on my part but do not know how to adapt optgroups
but do not know how to adapt optgroups
No, it should work... If you could reproduce the problem on jsbin or jsfiddle I could be able to help more...
ok then I'll put in jsbin or jsFiddle and I put my code, thanks for the support I will leave it
I did not take
thanks for the support
You're welcome. I will be a lot easier with a jsbin/jsfiddle to play with.
is the component of the search engine, I just do not look in the groups option in the options just do not know if I understand ???? any idea how to solve:
I can't help you with a screenshot only. Please reproduce the problem on jsbin or jsfiddle I could be able to help.
can you tell me if you see: https://gist.github.com/anonymous/a355598b1bc069d0d3a1
is more or less like I'm driving alone I need a search engine and the images that had showing you earlier , make inquiries about parents and children and hide you can not find but parents and also also the children I am working with the library quicksearch adapt him but not how it currently is working but I just look for the children not if I understand well ??
I do not see any 'input' element in your jsbin...
the input element itself generate the Flight from jQuery script in section
Your jsbin has an error in it (jQuery is not even loaded on the page)
What happens is that it has the libraries jaquey is needed, that of /jquery.multi - select.js , / jquery.quicksearch.js
I'm just showing you my code see paragraph AS build , which not only how to solve the question I have to hide in The optgroups in my Component WHEN I Search
What happens is that it has the libraries jaquey is needed, t
Yeah but if you want help from me, you need to be able to reproduce the problem on jsbin. If not, I am afraid I can't do anything else.
Using this plugin https://github.com/DeuxHuitHuit/quicksearch, you can do this.
$(document).ready(function() { $('#sector').multiSelect({
selectableOptgroup: true,
selectableHeader: "<input type='text' size='15px' class='search-input' autocomplete='on' placeholder='try \"12\"'>",
selectionHeader: "<input type='text' class='search-input' autocomplete='on' placeholder='try \"4\"'>",
afterInit: function(ms){
var that = this,
$selectableSearch = that.$selectableUl.prev(),
$selectionSearch = that.$selectionUl.prev(),
selectableSearchString = '#'+that.$container.attr('id')+' .ms-elem-selectable:not(.ms-selected)',
selectionSearchString = '#'+that.$container.attr('id')+' .ms-elem-selection.ms-selected';
that.qs1 = $selectableSearch.quicksearch(selectableSearchString,{
'show': function () {
$(this).prev(".ms-optgroup-label").show();
$(this).show();
},
'hide': function () {
$(this).prev(".ms-optgroup-label").hide();
$(this).hide();
}
})
.on('keydown', function(e){
if (e.which === 40){
that.$selectableUl.focus();
return false;
}
});
that.qs2 = $selectionSearch.quicksearch(selectionSearchString)
.on('keydown', function(e){
if (e.which == 40){
that.$selectionUl.focus();
return false;
}
});
},afterSelect: function(){
this.qs1.cache();
this.qs2.cache();
},
afterDeselect: function(){
this.qs1.cache();
this.qs2.cache();
}
});
This is working for me. Thanks I have 2 more issues
hi , the last script work 4 me i see the two inputs to search in the select , but i have a problem, in my page i see a select button that says nothing selected and i dont know why is right here i add my code and a screen of the issue(sorry 4 my inglish) html:
<select id="estudios" class="searchable" name="estudios[]" multiple="multiple">
<?
foreach($tipoestudios as $tipoestudio)
{
echo '<optgroup label="'.$tipoestudio->nombre.'">';
$catestudios = $this->m_estudios->obt_CatEstudios($tipoestudio->id);
foreach($catestudios as $catestudio)
{
echo '<option value="'.$catestudio->id.'">'.$catestudio->nombre.'</option>';
}
echo '</optgroup>';
}
?>
</select>
javascript:
Githubissues.
In the finder with multi select optgroup, to look for certain items, the search engine not only hides the parent searches pure children someone can support me