1👍
✅
Mocked up the functionaltiy you requested, using some slow, simple, exhaustive checks. —http://jsfiddle.net/B2Muh/3/
$(function () {
$filterArgs = $("ul li").filter(function () {
var txt = $(this).text();
return txt.indexOf("Filter") < 0;
});
$filterArgs.click(function () {
$(this).toggleClass('active');
$("table tr").hide();
$("table tr td").each(function () {
$rowData = $(this);
$filterArgs.filter(".active").each(function () {
if ($rowData.text() == $(this).text()) {
$rowData.parent().show();
return false;
}
});
});
});
});
0👍
I’ve written a sample code. I think this is what you want.
$('body').on('click','li',function(){
var filterText=$(this).html().trim();
var splicedTextArray=filterText.split(" ");
var filter=splicedTextArray[0].toLowerCase();
$('tr').each(function(index,value){
var valueText=$(this).find('td:first').html();
var isRegexmatch=valueText.toLowerCase().indexOf(filter);
if(isRegexmatch<0)
{
$(this).hide();
}else
{
$(this).show();
}
});
});
- [Answer]-Retrieving an object into django templatetags.
- [Answer]-Accessing Foreign Key values from a foreign key referenced model in django
- [Answer]-Django – filtering url responses
- [Answer]-ReferenceError: <Function> is not defined
- [Answer]-Django.db.migrations.graph.CircularDependencyError in Django 1.7.1
Source:stackexchange.com