I am generating a column as
$col = array();
$col["title"] = "Suppliers / Feedback";
$col["name"] = "problem_type_val";
$col["width"] = "150";
$col['on_data_display'] = array("display_type","");
$cols[] = $col;
function display_type($data)
{
$problem_type = $data["problem_type"];
$problem_type_val = $data["problem_type_val"];
//return print_r($data,true);
if($problem_type == 1) {
$qry = "SELECT supplier_name FROM suppliers WHERE suppliers_id = $problem_type_val";
$qry_run = mysql_query($qry);
$supplier_name = mysql_result($qry_run, 0);
return $supplier_name;
}
else if($problem_type == 6){
if($problem_type_val == 1)
$feedback = "Positive";
else
$feedback = "Negative";
return $feedback;
}
}
There are two types of Data. If problem type is equal to 1 then data will come from suppliers table and if problem type is equal to 6 then data is hard coded either Positive or Negative. Can you please guide why Search / Filter at the column top is not working ?
As mentioned in other ticket, For search operation, in background it uses WHERE condition of sql query. So we must have equivalent database sql for your condition.
As your current display logic is not simply mapped on sql query, you might need to write database function of same logic and use it in $col["dbname"] property like mentioned in following ticket.