have a dropdown that uses creates a list of values from the grid. When selecting any value from the dropdown, the grid refreshes but does not filter. Am I missing someting?
Perhaps, you are missing dbname property.
$col["dbname"] = "invheader.client_id"; // this is required as we need to search in name field, not id
Refer demos/appearance/dropdown.php for code sample in your licensed pack.
I do ave that,code isbelow
// begin dropdown cloumn
$col = array();
$col["title"] = "Grade";
$col["name"] = "Grade";
$col["dbname"] = "Grade"; # incase of conflict of field name in query, use exact table.field to search in
$col["width"] = "15";
$col["align"] = "left";
$col["search"] = true;
# fetch data from database, with alias k for key, v for value
$grade_lookup = $g->get_dropdown_values("select distinct grade as k, grade as v from Web_BoneyardTable where grade = 'SP300' or grade = 'SP350' or grade = '41X40' or grade = '00P20' or grade = 'P20HH' or grade = 'SP400' or grade = 'MEC75' or grade = 'MEC90' or grade = 'HP370'");
# these 3 lines will make dropdown in search autofilter
$col["stype"] = "select";
// blank row, then all db values – ; is record separator, : is key-value separator
$col["searchoptions"] = array("value" => ":;".$grade_lookup);
$col["editable"] = false;
$col["edittype"] = "select"; // render as select
$col["editoptions"] = array("value"=> $grade_lookup); // with these values "key:value;key:value;key:value"
$cols[] = $col;
//end dropdown
Hi,
Also paste the ->select_command query as it is actually used in searching.
and ->table property.
Try setting:
$g->select_command = "select * from [pltdata].[dbo].[Web_BoneyardTable] where grade = 'SP350' or grade = 'SP300' or grade = '41X40' or grade = '00P20' or grade = 'P20HH' or grade = 'SP400' or grade = 'MEC75' or grade = 'MEC90' or grade = 'HP370'";
to
$g->select_command = "select * from [pltdata].[dbo].[Web_BoneyardTable] where (grade = 'SP350' or grade = 'SP300' or grade = '41X40' or grade = '00P20' or grade = 'P20HH' or grade = 'SP400' or grade = 'MEC75' or grade = 'MEC90' or grade = 'HP370')";
use ( ) in where or condition group. looks like additional query is just AND'ing to last grade=hp370 condition.