Filtering by the variables I send with the get method

Filtering by the variables I send with the get method

emrahozsahinemrahozsahin Posts: 8Questions: 1Answers: 0

I have variables that I created with preg match in index.php. When I click on these links, I want the results to be filtered with data tables. I can list all the results, but how can I get it to filter by the data sent with get ?

Replies

  • kthorngrenkthorngren Posts: 21,337Questions: 26Answers: 4,954

    I'm not sure I understand what you are looking for. Maybe you are looking to use ajax.data as a function, like this example to send the search parameters to the server. Or are you looking for deep linking into the Datatable?

    If these don't help then please provide more details of your requirements.

    Kevin

  • emrahozsahinemrahozsahin Posts: 8Questions: 1Answers: 0
    edited July 2023

    Yes, something similar to that I was talking about. I want to filter by button click according to different Where conditions.

    When I click on the fixed buttons, I want to list by sending parameters according to more than one condition. I want to create fixed search patterns instead of typing the search text.

    For example index.php
    <a href="....com/ajax.php?categoryID=4&country=brighton">
    <a href="....com/ajax.php?categoryID=3&country=london">

    Results
    4-Brighton
    4-Brighton
    4-Brighton

    Results
    3-London
    3-London
    3-London

  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395
  • emrahozsahinemrahozsahin Posts: 8Questions: 1Answers: 0
    edited July 2023

    Even though I add the required criteria, it doesn't give any results. Lists all data

  • emrahozsahinemrahozsahin Posts: 8Questions: 1Answers: 0
    edited July 2023

    It seems that the search conditions cannot be transmitted.
    https://live.datatables.net/qoliyehi/15/edit
    When I compare it with the one in this link, the parameters I wrote to the search filters do not appear here, even though I apply the same code.

    my code

    Working example

  • kthorngrenkthorngren Posts: 21,337Questions: 26Answers: 4,954
    edited July 2023

    The only thing I can think of is you are not loading the SearchBuilder library or its being loaded at the wrong time. Also make sure you have the latest version of SearchBuilder loaded. Anything before SearchBuilder 1.2.0 didn't support server side processing.

    If none of these help then please post a link to your page or a test case replicating the issue so we can help debug.
    https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case

    Kevin

  • emrahozsahinemrahozsahin Posts: 8Questions: 1Answers: 0

    https://live.datatables.net/qoliyehi/38/edit

    objects.php
    https://github.com/DataTables/DataTables/blob/master/examples/server_side/scripts/objects.php

    I am using the objects.php file in this link

    https://github.com/DataTables/DataTables/blob/master/examples/server_side/scripts/ssp.class.php

    I am using the ssp.class.php file in this link

    There is a structure consisting of a total of 650.000 data and 23 columns.

  • kthorngrenkthorngren Posts: 21,337Questions: 26Answers: 4,954
    edited July 2023

    The test case is working. The server scripts won't affect the client side SearchBuilder's ability to send the parameters. To help debug we will need to see the running problem.

    Have you validated the version of SearchBuilder you are using?

    Kevin

  • kthorngrenkthorngren Posts: 21,337Questions: 26Answers: 4,954

    Post your Datatables init code. Maybe something is wrong there.

    Kevin

  • emrahozsahinemrahozsahin Posts: 8Questions: 1Answers: 0
    edited July 2023

    https://we.tl/t-tTqIEGl9UQ?utm_campaign=TRN_TDL_05&utm_source=sendgrid&utm_medium=email&trk=TRN_TDL_05

    I started from the beginning to work on localhost according to the original codes. But here, too, I could not succeed. I am sending all the codes in their original form.

  • kthorngrenkthorngren Posts: 21,337Questions: 26Answers: 4,954
    edited July 2023

    I just realized you are using the ssp.class.php library. This does not support the additional SearchBuilder parameters sent. However you should see the parameters sent in your browser's network inspector.

    You can use the Editor server side library which does support SearchBuilder. See the SearchBuilder docs for more info. See this blog for how to use the Editor server side library.

    Kevin

  • kthorngrenkthorngren Posts: 21,337Questions: 26Answers: 4,954

    I noticed that you aren't displaying the SearchBuilder interface. If this is the case then maybe search.search or searchCols will fit your needs and will work with the ssp.class.php script.

    Kevin

Sign In or Register to comment.