Giter VIP home page Giter VIP logo

filtie.js's People

Watchers

 avatar  avatar

filtie.js's Issues

Disable filtie for certain columns

You should be able to determine which columns have sortie on them and which do not.

This could be done with attributes on the table, options, or data- attributes on the relevant .

Actually add/remove rows

Currently, Filtie just uses the hidden attribute to toggle rows. However, as can be seen in the demo provided with the software, this messes up using CSS's nth-child selector to highlight alternate rows. It probably also causes problems with other software which doesn't expect the rows to be hidden (e.g. if counting the rows in a table).

Instead, Filtie should actually remove the rows from the DOM and reinsert them as required. This means that the contents of the DOM are reflective of what the user sees.

I would expect we'd do this by tracking all of the rows in an array and testing that array to determine which need to be added/removed.

Problems:

  • How do we know where to reinsert the rows?
  • What if a row has been removed (upsetting indices and relative positioning)?
  • What if a table has been sorted, changing the order of the visible rows?

Add callback handler after input added

Developers should be able to attach a callback when an input is added. Either through an option in the config:

Filtie.create({
  onAddInput: function($input) {...}
});

Or as a custom event:

$table.addEventListener('filtie:addInput', function() {
  ...
});

This will allow developers to add classes to the input, or custom listeners or attributes.

Allow filtering from external fields

Developers should be able to configure an external field to filter a particular column. This would allow you to e.g. have a select box in the page header that determines which product groups to show.

Expected markup would be:

var filtieInstance = Filtie.create($table);
filtieInstance.addFilter(4, $selectBox);

Which would make $selectBox a filter for column 4 (0-indexed).

Write tests

Write unit tests to ensure Filtie's features work as expected

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.