2
I would like to make a filter inside the sub-menu, filtering the menu itself as you type it will display the related.
The idea would be similar to this link. At the end of my menu has sub-menu called store or Adm.
2
I would like to make a filter inside the sub-menu, filtering the menu itself as you type it will display the related.
The idea would be similar to this link. At the end of my menu has sub-menu called store or Adm.
1
You can create such a filter:
$('#filter').on('keyup', function(){
var dataFilter = $(this);
var valorBusca = dataFilter.val();
var contaLetras = valorBusca.length;
if (contaLetras >= 1) {
filterData(valorBusca);
} else {
$('.navbar-nav li a').parent().show();
}
function filterData(data) {
$('.navbar-nav li a').each(function(iIndex, sElement) {
$(sElement).parent().hide();
if (sElement.innerHTML.indexOf(data) !== -1) {
$(sElement).parent().show();
}
});
}
function retiraAcentos(palavra) {
var com_acento = 'áàãâäéèêëíìîïóòõôöúùûüçÁÀÃÂÄÉÈÊËÍÌÎÏÓÒÕÖÔÚÙÛÜÇ';
var sem_acento = 'aaaaaeeeeiiiiooooouuuucAAAAAEEEEIIIIOOOOOUUUUC';
var nova='';
for(i=0;i<palavra.length;i++) {
if (com_acento.search(palavra.substr(i,1))>=0) {
nova+=sem_acento.substr(com_acento.search(palavra.substr(i,1)),1);
}
else {
nova+=palavra.substr(i,1);
}
}
return $.trim(nova).toLowerCase();
}
});
Here is the Jsfiddle: http://jsfiddle.net/ivanferrer/1L8Lc86s/1/
Here theme full version: http://jsfiddle.net/ivanferrer/1L8Lc86s/5/
Browser other questions tagged javascript jquery css bootstrap-3
You are not signed in. Login or sign up in order to post.
I added the comments here on the question. I hope I haven’t forgotten anything...
– Sergio
@Welguri try to do something with the dial
contains
. Only that he is case sensitive, use thelowercase
like you did won’t help.– KaduAmaral
Then @Kaduamaral tried to base myself on the example that searches the table http://bootsnipp.com/snippets/featured/panel-table-with-filters-per-column ... for me this still too complex. :(
– Weliton Figueiredo