Hello im user of pro version
im using gridphp with mongo database, from mongo database i get php array and i set data source as php array all works fine except i cant filter column user_id by email ( by text search eg “n”) i can use drop down values but wish to have option to filter by part of the email as string. It seems that option is only feasible with real database connection.
$col = []; $col["title"] = "Client"; $col["name"] = "user_id"; $col["dbname"] = "email"; // this is required as we need to search in name field, not id $col["width"] = "100"; $col["align"] = "left"; $col["search"] = true; $col["editable"] = true; $col["export"] = false; // not for export $col["edittype"] = "select"; // render as select $col["editoptions"]=[ "value" => ":;".implode(";",$users_list), "separator" => ":", "delimiter" => ";", "defaultValue"=>"" ]; $col["searchoptions"]=[ "value" => ":;".implode(";",$users_list), "separator" => ":", "delimiter" => ";", "defaultValue"=>"" ]; // $col["editrules"] = array("required"=>true); $col["formatter"] = "select"; // display label, not value $cols[] = $col; ...
$g->table = $data; // blank array(); will show no records //data array has items
$data=[];
$data[]=[“user_id”=>1,”email’:”[email protected]”]
Non working with text search
Working with select dropdown
I forget to wrote that $user_list[]=\\\”1:[email protected]] kas key:value shema as requested
If you don’t wish to use select dropdown in filter, you can change the key:value pair to use as email:email instead of id:email.
Change 1:[email protected] to [email protected]:[email protected]. This will enable text searching.