Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82226

How to multi search for ajax datatable

$
0
0

I made a tools for my panel which can manage permissions but i need your help to fix the datatable.
This is preview of my datatable:

At first of all let me explain how this table filling out! (in first columns which is shows "panel_admins" made with primary_key(ID) it means it made by formatter like this code :

array_push( $columns, array( 'db' => "table_id", 'dt' => 0 , 'formatter' => function( $id) { $res_table=$conn->query("SELECT * FROM tables WHERE id='".$id."'"); if($res_table->rowCount()!=0){ $table=$res_table->fetch(); return ($table['name']); }else{ return ("Undefined"); } } ));

!* this array will use for ssp.class.php with simple function *!

So as you can see this code converting the id of table to the name of table but if we search name of table its not gonna return the name of table and its gonna return nothing but i made something to fix it and its ok but the second problem is i can't search multi items.

what do i need is this :

as you can see there is an option which is allow peoples to use multi table and the value of this select element will be like this : [1,2,3] and 1 is id of first table name and 2 is id of second table name and 3 is id of third table name.

I have an code to filter this table with only one table name : $('#datatable').DataTable().column(0).search("1").draw();

This code will filter the table with only one result but what can i do if i want to filter this table with more than one result because my select element has multi select option and the value of my select element is an array like this ['1','2','3',...]

I hope it was understandable because my English is not good enough sorry for that and thanks a lot for giving me your time.


Viewing all articles
Browse latest Browse all 82226

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>