Is it possible to set a Filter per column?

Is it possible to set a Filter per column?

zerennerzerenner Posts: 16Questions: 6Answers: 0

Hello,

i want to have a filter per column. The input field should be shown above the column title. If I set the first filter then the second filter should be filter the rows from the first filtered data. Is this possible and is there an example how i can get this function?

Thank you for your anserwer.

Dirk

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599
    edited April 2018

    Hi @zerenner ,

    Do you mean something like this - http://live.datatables.net/gepatita/1/edit . This was for a different thread, but it shows filtering with a per column input element.

    Hope that helps,

    Cheers,

    Colin

  • zerennerzerenner Posts: 16Questions: 6Answers: 0

    Hi Collin,

    the link is not working.

    Can you send me the correct link?

    Thanks.

    Dirk

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    @zerenner - can you try again please, the period on the end of the link was affecting it.

  • zerennerzerenner Posts: 16Questions: 6Answers: 0

    Yes, that is what i mean.

  • zerennerzerenner Posts: 16Questions: 6Answers: 0

    Hi Collin,

    I will try it. Thanks for your help.

    Dirk

  • zerennerzerenner Posts: 16Questions: 6Answers: 0

    @Collin - i have try to implement the function but i get only an error that there is an unexpected string. i´m new for programming with php and javascript and i can´t see the mistake. the wqebsite is an intranet site, so i can give you only the documents. Can you help me again?

    i use 3 documents the defaultSite .implements all stylesheet und js files an has the menubar for all sites. the nachrichten.phtml site is the main site und geht the ajax datas from nachrichtenController.php. (I have zip the files bechause the .phtml ist noct allowed.)

    thanks for your help.

    Dirk

  • allanallan Posts: 63,368Questions: 1Answers: 10,449 Site admin

    Does the error say what file and line it is coming from?

    Allan

  • zerennerzerenner Posts: 16Questions: 6Answers: 0

    @allan: Sorry for the long response. I was three weeks not in the office. I have try again to implement the filterboxes and now it is running. Thanks for your help.

    I have now problems with the length of the fields. So i can't change the width of the filterboxes (see the screenshoot of the Table). How can i change the boxes so that i have a compact size (https://datatables.net/manual/styling/classes#Examples)?

    Thanks for your help.

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Hi @zerenner,

    You can use the CSS width property to change the width of those elements.

    Cheers,

    Colin

This discussion has been closed.