I have a combo box and grid and I need to make the grid data change to display detail data when the current selected item in the combo box change.
Here is the code of the combo box:
<input class="easyui-combobox" name="wg_id" id="wg_id" value="1"
data-options="
url:'pages/get_work_groups.php',
method:'get',
valueField:'work_group_id',
textField:'work_group',
panelHeight:'auto',
onSelect: function(rec){
}
">
The PHP file that I get json data from:
include '../conn.php';
$wg_id = 1;
if (isset($_REQUEST['wg_id'])) {
$wg_id = $_REQUEST['wg_id'];
}
$q = $conn->prepare("select * from locations where work_group_id = :wg_id");
$q->bindValue(':wg_id', $wg_id);
$q->execute();
$result = $q->fetchAll();
echo json_encode($result);
What is the code I should use in the onSelect event to reload grid data ?