Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

One set of filters for multiple tables #80

Closed
Muhahe opened this issue Sep 2, 2014 · 18 comments
Closed

One set of filters for multiple tables #80

Muhahe opened this issue Sep 2, 2014 · 18 comments

Comments

@Muhahe
Copy link

Muhahe commented Sep 2, 2014

Hi, is possible to have one set of filters for filtering multiple tables with different datasets? I looked to all examples and cant find anything about it.

@vedmack
Copy link
Owner

vedmack commented Sep 2, 2014

Hi,
Sounds like a possible new feature... such filter will probably use the filter_container_id , what filter type you need it for? Please provide a more detailed specifications for the feature, but know that it will take time as I'm busy with my job and there are already several open issues here...

@Muhahe
Copy link
Author

Muhahe commented Sep 2, 2014

Im using multifilter for all columns, and i will need it to continue my job :) so i will try to make some modifications, maybe aditions, but who knows how dirty code it will be.
My thought is that i have web page when you have projects and and tasks which are tasks and subtasks, and i wana to display it in "tree structure". Table -> subtable, and customer have demant that there have to be a one filter for subtables.
So at the top of the main table i would like to have separate filter.

And by code i have thought that .js file will accept data for filters and will pass them to multiple tables. In past i made it in columnFilterWidget made by CyberHobo, but this widget is not working well with 1.10 with my necessary modifications.

@vedmack
Copy link
Owner

vedmack commented Sep 3, 2014

what multifilter are you using? I'm guessing that you want a text filter for multiple table?

@Muhahe
Copy link
Author

Muhahe commented Sep 3, 2014

yes text filter for multiple table. Same as its here http://jsbin.com/yigigukakuju/1/edit and i wana another set of filters above, which will affect multiple tables (which will be nested in main table)

@vedmack
Copy link
Owner

vedmack commented Sep 3, 2014

I understand your feature request regarding a text filter for multiple tables, but what do you mean by " i wana another set of filters above, which will affect multiple tables (which will be nested in main table)"

In short, all you want is to be able to create a text filter that will affect multiple table ?

@Muhahe
Copy link
Author

Muhahe commented Sep 3, 2014

im sorry, my english is not good. So i will try to describe it much better. I wana to have one main table with filter just for the main table. Main table will have nested tables with different datas (main table is projects and subtables will be tasks for projects) and e.g. above the main table will be another filter, which will filter subtables, all of them.

Here https://dl.dropboxusercontent.com/u/18032222/datatablesFilters.png is screen so everything should be clear :)

@vedmack
Copy link
Owner

vedmack commented Sep 3, 2014

First - not my business, but still an opinion :) , I have to say that the page looks very complicated (I hope that its for an advanced user) I mean even with manual labels that you wrote on the picture its still looks complicated...
Now.. to our subject, you want that filter in the upper right corner to be able to filter the main table and all its inner tables? for that you will have to provide to yadcf all those tables instances, if that's all then ok...

@Muhahe
Copy link
Author

Muhahe commented Sep 3, 2014

This is how boss wana it, and in real its not too complicated, its just look as it is :) It just represent projects and task in tree structure in tables. Before this they have it in excel, and it was complicated :D this should provide easier acces and control about project management. If you are interested i can provide you a acces when it will be in some phase.

About topic, so if i provide table instances to yadcf and specifi e.g. external place for filters it should work? that sounds nice :) i will test it, but for now i need to finish nesting tables

@vedmack
Copy link
Owner

vedmack commented Sep 3, 2014

I was describing how the future api of datatables for this feature will work... its not implemented yet... :)

@Muhahe
Copy link
Author

Muhahe commented Sep 3, 2014

okay so i will try it :) in cyberHobos columnFilterWidget i made something, but it was a bit dirty :D

@vedmack
Copy link
Owner

vedmack commented Sep 6, 2014

Check out the new 0.8.4.beta.3, see the new filter on http://yadcf-showcase.appspot.com/DOM_Ajax_Multiple_1.10.html

usage

yadcf.initFilterMultipleTables([oTable, oTable2], {filter_container_id: 'multi-table-filter', filter_default_label: 'Filter all tables!'});

supported options currently are

filter_default_label
filter_container_id
filter_reset_button_text
filter_delay

@Muhahe
Copy link
Author

Muhahe commented Sep 8, 2014

wooow seems great :) im excited to try it :) but unfortunatly im stuck on another issue, but i will give you feedback ASAP

@Muhahe
Copy link
Author

Muhahe commented Sep 12, 2014

So i finaly tryied to test multifilter and it seems to work :) but i have few questions. If you look at my example here http://krtkovo.8u.cz/www/projects/ login karel.kozelka password karel and be sure that you are on Projects page, you can see what is im working on.

  1. In main table, there are subtables (for project 01 and task 01). When i filter main table, and then try filter subtables with multifilter, multifilter is applied only to present tables. So is there an option to pass existing filter to newly created tables?
  2. current multifilter is textfilter, is there an option to be it multiselect filter as for main table? Data to filter probably from external input, not from subtables :)
  3. If i understand it well, curently you using filters by selecting DOM element if im correct, but would be here some option to pass jquery object to filter and use it? So if jquery oblect will be in variable etc, it should be filtered without inserting to DOM. If you look at my + - signs which are used for show/hide child tables, im using jquery insertAfter and detach (jquery object is only taken from DOM, not removed) and then i just insert him back and dont have to initialize datatable again
  4. or another idea is to have multifilter independed from table, add him num of columns, specification of columns, array with data and list of table names? Is this even possible?

@vedmack
Copy link
Owner

vedmack commented Sep 16, 2014

Hi,

Hopefully I will look at it in the weekend (very very busy this days) , regarding specific features request such as adding multiselect support for "FilterMultipleTables" / etc you should open a new issue (you should know that the multiselect will have to get a data array from you with predefined values because asking yadcf to populate it based on all available values from all tables will be very "heavy" operation)

@vedmack
Copy link
Owner

vedmack commented Sep 22, 2014

Tried your link but it looks down? getting "403 - Přístup odepřen" in the center of the page, I didn't understand your third question and the fourth either in the fourth question , did you mean something like in this issue? #79

@Muhahe
Copy link
Author

Muhahe commented Sep 24, 2014

I look at it now and it seems working to me. Will try from another pc. My goal is to have multifilter (multiple filter inputs) to which i can specify input (because i will feed data from multiple tables, and will add and remove them from DOM via javascript (on the fly)). Is this much better description?

@Muhahe
Copy link
Author

Muhahe commented Oct 7, 2014

In other words i need to have your filter as it is, but option to specify to select data from e.g. array, instead of datatables on which filter is created. Then posibility to tell which tables (multiple) should filter works on. And this for whole filter. I think it should not be many changes, and im trying to made it myself, but my progress is so slow because i dont wana make much mess in your code

vedmack added a commit that referenced this issue Oct 7, 2014
* New feature, added initFilterMultipleTables function, one (currently only filter_type: "text") filter for multiple tables - filter at once! #80
* New feature, added exResetAllFilters function: Allows to reset all filters externally/programmatically (support ALL filter types!!!) , perfect for adding a "reset all" button to your page! #78
* exGetColumnFilterVal support new Datatable  (Capital "D") https://groups.google.com/forum/#!topic/daniels_code/4ryW4_0P2EE
* Fixed IE8 issues #73
* Migrated to MIT license #82
* Better support for columnDefs
* Date filtering with server side configuration will send the value / from-to (if range date) as is (without converting into milliseconds)
* Bug fixes #83
@vedmack
Copy link
Owner

vedmack commented Oct 7, 2014

closing this one, you should open a new issue for adding filter_type: "select" with support for the data attribute

@vedmack vedmack closed this as completed Oct 7, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants