Git Product home page Git Product logo

dom-filter's Introduction

DOM Filter jQuery plugin

a flexible and performatic DOM search plugin developed by the Lápis Raro team.

Usage

basic

on this basic usage, all the #table1 rows will be filtered based on the first text input's term

$(document).ready(function() {
	$('#table1').domFilter();
});

options

  • elements - selector of the row elements to be shown or hidden. Default value is 'tr'.
  • input - input element to perform the search. The default value is $('input[type=text]')[0], which is the first text input on the page.
  • searchable - selector that defines where the search will be performed within each row. The default value is an empty string (searches the entire row).
  • alternataClasses - defines whether the plugin will apply alternate classes on the rows or not. Dafault value is false.
  • oddClass - class for the odd rows, applied if alternataClasses is set to true. Defaults to 'odd'.
  • evenClass - class for the even rows, applied if alternataClasses is set to true. Defaults to 'even'.
  • ignoreFirstRow - whether the first row will be ignored or not (default: true)
  • beforeQuery - function called just before the filter is applied on a query, when the first character is typed (default: null)

example on how to filter a list and set a specific input text field:

$(document).ready(function() {
	$('ul#list1').domFilter({
		elements: 'li',
		input: $('#input_1')
	});
});	

example on how to filter rows based on a specific td class

$(document).ready(function() {
	$('table').domFilter({
		searchable: 'td.searchable'
	});
});	

dom-filter's People

Contributors

victorbv avatar

Stargazers

 avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.