Individual column filtering with Multiple tables

Individual column filtering with Multiple tables

martoofmartoof Posts: 32Questions: 0Answers: 0
edited February 2011 in General
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 !

Replies

  • martoofmartoof Posts: 32Questions: 0Answers: 0
    Up please ! It's very important :)
  • 28.vivek.s28.vivek.s Posts: 69Questions: 0Answers: 0
    the column which you want to be filter is having same column no in all tables or not?
    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
  • martoofmartoof Posts: 32Questions: 0Answers: 0
    Hi ! thank you for your help Vivek! :)
    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
  • 28.vivek.s28.vivek.s Posts: 69Questions: 0Answers: 0
    edited February 2011
    you can use the same concept as allan has given in http://datatables.net/examples/api/regex.html to filter on columns irrespective of how many tabels you have...
    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]
  • martoofmartoof Posts: 32Questions: 0Answers: 0
    edited February 2011
    Hi !
    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 :(
  • 28.vivek.s28.vivek.s Posts: 69Questions: 0Answers: 0
    edited February 2011
    i have implement the same thing but i can not show you right now because it's on testing phase wait till..13-feb..then it will be pushed on production on this link..http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=S08EL&fpsp=1&tab=Design_Tools_Tab

    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
  • martoofmartoof Posts: 32Questions: 0Answers: 0
    edited February 2011
    Thank you for your time Vivek !
    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)^^
  • martoofmartoof Posts: 32Questions: 0Answers: 0
    can you help me again please Vivek :)
  • 28.vivek.s28.vivek.s Posts: 69Questions: 0Answers: 0
    edited February 2011
    go to this link http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=S08EL&fpsp=1&tab=Design_Tools_Tab and tell me this is what you want....

    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
  • martoofmartoof Posts: 32Questions: 0Answers: 0
    Hello 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.
  • martoofmartoof Posts: 32Questions: 0Answers: 0
    Up please :)
  • martoofmartoof Posts: 32Questions: 0Answers: 0
    Hello, I restart the conversation because the syntax 'option1|option2|...|optionN ' does not work...
    [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
  • martoofmartoof Posts: 32Questions: 0Answers: 0
    edited May 2011
    up please !
    I am very interested in this topic :)
This discussion has been closed.