Quantcast
Channel: Free community support — DataTables forums
Viewing all articles
Browse latest Browse all 35271

datatables 1.10 and YADCF - passing value in column to php script

$
0
0

I'm using datatables 1.10 and YADCF to display the inventory of a client. This works perfectly as all my data comes up. I'm using server_side processing as there is a ton of data. My problem comes when an admin wants to see all their computers with 6mg of ram for instance. Currently, the user types in "6", and I'd like to have that value passed to the server_processing script which will run the mysql query. Here is how I am setting up my datatables:

        $(document).ready(function() {
             var oTable = $('#example').DataTable( {         
               "bProcessing": true,
              "bServerSide": true,
              "bFilter": false,
               "ajax":  {
                     "url": "scripts/server_processing.php",
                     "type" : "POST",
                     "data": {
                        "ram" : "ram" }                 // test
               },
               "sServerMethod" : "POST",
               "columns": [ 
                    {
                        "class":          "details-control",
                        "orderable":      false,
                        "data":           null,
                        "defaultContent": ""
                    },
                    { "data": "manu" },
                    { "data": "ram" },
                    { "data": "cpu" },
                    { "data": "location" },
               { "data": "room" },
                    { "data": "owner" }
                ],
            "order": [[1, 'asc']]
            });......

Then in server_processing.php, I try to grab the search parameter typed in by the user:

```php
$ram= $_POST['ram'];
``````

However, when I look in Firebug at the data passed, I don't see any value in [columns][1][search][value]

How do I pass the values a user types into the filter box that YADCF presents?

Also, this data resides on a client's internal LAN, so I cannot put a live system out for everyone to see.


Viewing all articles
Browse latest Browse all 35271

Trending Articles