The datatable class contians "addfilter(filed_name,'select',label,operator,array of data)" method to add new select filter
ID | Username | Firstname | Lastname |
---|
$dt->addfilter(filed_name,'select',label,operator,array of data); operator takes the following values: = < > >= <= != likeFor example:
$dt = new Your/Datatable/Class( array( 'firstname' => 'Firstname', 'lastname' => 'Lastname' )); $dt->addfilter('id','select','UserID','=',array(1=>'S3400',2=>'S400',4=>'S200')); return $dt->display('Your/Blade/Template',$request);in your blade template where you want your datatable appears put the following code:
@include('phpdt::datatable_view') @section('datatable_section') @parent @show
The argument filed_name passed in "addfilter" must be declared in the select statement of your datatable class.
By: Mohammad Alaa Aldeen
Git: https://github.com/mhdalaaaldeen