Individual column filtering with Multiple tables
Individual column filtering with Multiple tables
Hello everyone!
I could use multiple tables in one page with a global filter but also with a filter by column and table using a drop down multiple ( ).
I am able to combine several tables with a global filter, however, I fail to understand how the filtering column when there are multiple tables (which have different columns!) and thanks to
I hope I was specific enough, I'm French and my English is as limited as my knowledge in Javascript.
Thank you to your help !
I could use multiple tables in one page with a global filter but also with a filter by column and table using a drop down multiple ( ).
I am able to combine several tables with a global filter, however, I fail to understand how the filtering column when there are multiple tables (which have different columns!) and thanks to
I hope I was specific enough, I'm French and my English is as limited as my knowledge in Javascript.
Thank you to your help !
This discussion has been closed.
Replies
i am assuming yes...then you could do something like this...
[code]oTable1.fnFilter('text',columnNo)
oTable2.fnFilter('text',columnNo)
oTable3.fnFilter('text',columnNo)
.
.
oTablen.fnFilter('text',columnNo)[/code]
or you can do one more thing have a reference of all table in array and while filtering iterate over that array..like this...
[code]
var reference =['table1','table2',......]
for (var i =0;i
However, I do not know much about the jquery / javascript.
I'm just tweaking the sample datatable.
Could you provide me a more complete code?
[code]
...
/*-----------------------------------------------------------------------------------------------*/
/* *** D
even i could not understood these lines written by you...---[code]I want that if I select one ore more options,so there is a filtering in the column 3 [(for example): "Marque" (it's the same name)] to my 2 tabs-----[/code]
but what i got from your question is that you want column filtering with multiple input text...if it's yes...then do something like this...
[code]
$('#example').dataTable().fnFilter( 'option1|option2|...|optionN ',columnNo,true,false);
[/code]
I try all the day and I failed.
Can you give me an exemple with all the code page ?
I would like this :
http://datatables.net/examples/api/regex.html
but with multiple tables on the same page and not with input text but with a
[code]
...
[/code]
Help me please !
I'm looking for too long now :(
but as i said earlier in my post..you have to do same thing whether it's input text or list values...you have to capture those value and passed it to this function like this..
[code]$('#example').dataTable().fnFilter( 'option1|option2|...|optionN ',columnNo);[/code]
for example if your list is like..
[code]
Item 1
Item 2
Item 3
Item 4
then in jquery fetch selected options value..
$(document).ready(function() {
var selectedList = "";
$('#select-from option:selected').each( function() {
selectedList +=$(this).val()//(this).text() you can use this also.
});
/*Then call fnFilter to filter multiple table with selected values..like this i am assuming that you have reference of all tables in an array.*/
for (var i =0;i
I'm not very good apparently! It's been 2 hours that I try but it does not work.
Could you try to change my previous code so that I can apply in my case? And thus have a correct example to understand your reasoning:)
I know I take a lot of your time but it's not easy for a beginner like me!
I am really grateful to you! thank you
(you can delete my "select multiple" and use yours, I want just an example with "multiple tables" and two "select multiple" on the same page to understand)^^
i have a div in place of dropDown(your requirement) but i am doing the same thing...you can select multiple option from that div by checking checkboxes and perform filtering over multiple tables on the same page...
is this what you want? if yes, then i can guide you...
Click on filter by vendor then you will get that div(it will be a list in your case:))..
let me know whether you want something similar to this or your requirement is totally different from this...then i will give you all code related to this.
Regards,
Vivek
Sorry it took so long to answer you but I was sure to have already done!
I do not really see what I want on your link.
You do not understand what I want? I know my English is not good and I apologize again.
I'll try to rephrase:
I need this: http://datatables.net/examples/api/regex.html
With:
- multiple tables
- A "multiple select" instead of "input" to Column 1, Column 2 ...
Look at my code to correct it so that I can find my way!
Thank you very much.
[code]
$('#example').dataTable().fnFilterAll( 'option1|option2|...|optionN ',columnNo,true,false);
[/code]
and by the way, can you tell me in simple words what is 'true' and 'false' ?
I read this : http://datatables.net/plug-ins/api#fnFilterAll , but it's really complicated to a french as me !
Thanks
I am very interested in this topic :)