I am trying to add custom filter to my customer table. Can you help me about creating custom filters

I am trying to add custom filter to my customer table. Can you help me about creating custom filters

eray2604eray2604 Posts: 7Questions: 1Answers: 0
edited November 2020 in Free community support

I want to add filter to my datatables.net table. There is only '10-25-50' filter for the 'show results'. But I want to add custom filter like searchbuilder. I have done in Introducing SearchBuilder page. But i can not change or add in the code.

Answers

  • sandysandy Posts: 913Questions: 0Answers: 236

    Hi @eray2604 ,

    Thanks for your question. As noted in the forum rules, please post a link to a running test case showing the issue so we can offer some help. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Thanks,
    Sandy

  • eray2604eray2604 Posts: 7Questions: 1Answers: 0

    Hi @sandy,

    I want to use this filter in my project. There was an already datatables.net code for the filter is :
    . If you show me how can i use the custom filter that i add first one. It would amazing for me. Thanks..

  • sandysandy Posts: 913Questions: 0Answers: 236

    Hi @eray2604 ,

    Have you added SearchBuilder to your DataTables config? Take a look at this page.

    Thanks,
    Sandy

  • eray2604eray2604 Posts: 7Questions: 1Answers: 0

    Hi @sandy,
    I have not. I don't understand the 'dom' part.

  • colincolin Posts: 15,146Questions: 1Answers: 2,586

    dom defines which elements you want in the table, and where they'll be placed - so you need to add the Q for SearchBuilder.

    If that doesn't help, as requested already, please provide a test case demonstrating the problem,

    Colin

  • eray2604eray2604 Posts: 7Questions: 1Answers: 0

    Thank you @colin,
    Basically, I want to add a after date filter here : . But ı dont know to how. I dont know how to use searchbuilder in CODE.

  • sandysandy Posts: 913Questions: 0Answers: 236

    @eray2604 ,

    The documentation that we have linked to explains it well. I've created a live page that shows how to get SearchBuilder working in a very basic form you can access it through this link. Can you edit that to show where you are having trouble? What does your current DataTables initialisation look like?

    Thanks,
    Sandy

  • eray2604eray2604 Posts: 7Questions: 1Answers: 0

    First of all thank you for your effort @sandy. Here is my request for my project and my project php and js codes:


  • sandysandy Posts: 913Questions: 0Answers: 236

    Hi @eray2604 ,

    Neither of the first pictures show your DataTables initialisation. This is the javascript in the form

    $('#example').DataTable();
    

    Can you show me that code please? Or change your project accordingly as shown in the example to display SearchBuilder.

    Thanks,
    Sandy

  • eray2604eray2604 Posts: 7Questions: 1Answers: 0

    Hi @sandy first of all i appreciate it. I solve my problem. Now i want to integrate new datatables documents to my project. The problem is in my project there is already a datatables folder but old. That's why i can not add searchbuilder or add condition statement. I want to change old on instead new one. I test new package its working. But my question is which folder i should delete in my project.

  • colincolin Posts: 15,146Questions: 1Answers: 2,586

    At a guess, I'd say anything starting with datatables, and then install again, but I'm not too familiar with that,

    Colin

  • eray2604eray2604 Posts: 7Questions: 1Answers: 0


    what's wrong?

  • colincolin Posts: 15,146Questions: 1Answers: 2,586

    We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

This discussion has been closed.