Hi!
In 6.0 I created a list menu with an onchange event what is based on the example (Add dropdown list box with values for search in the help)
It is work perfect. When I click on the current element the list page reloaded and show the data.
I would like to use it with ajax, to not reload the entire page only the datagrid.
It is work with pagination, and shorting but how can I do it from another element of page.
mode=ajax is not work.
please help!
Thanx!
BR:
Dennis
Here is my Code:
<?php
//create dropdown box
$termek_menu = "";
$termek_menu.= "
<style type=\"text/css\">
.styled-select select {
background: transparent;
border: 1px solid #ccc;
font-size: 10px;
width: 180px;
}
</style>";
$termek_menu.="<center>Termékcsoportok:</center><div class=\"styled-select\">";
$termek_menu.= "<select size=\"15\" onchange=\"window.location.href=this.options[this.selectedIndex].value;\">\n";
//select values from database
global $conn;
db_query('SET NAMES LATIN2',$conn);
$strSQL = "select * from shopcategories_node_status sns where (sns.szam > 0 and sns.x='Node') or (sns.szam = 0 and sns.x='Üres Node')";
$rs = db_query($strSQL,$conn);
while ($data = db_fetch_array($rs))
{
$termek_menu.="<option ".(($data["Category_id"] == $_REQUEST["value11"]) ? "selected":"")." value=\"shopinventory_list.php?subkey=".$data['key_']."&alkat=a&ctlSearchFor=&srchOptShowStatus=0&ctrlTypeComboStatus=0&srchWinShowStatus=0&a=integrated&id=1&criteria=and&value11=".htmlspecialchars(rawurlencode($data["Category_id"]))."&field1=Category_id&option1=Equals\">".$data["Category_class"]."</option>\n";
}
$termek_menu.="</select>";
$termek_menu.="</div>";
//Kategória választó
global $conn;
db_query('SET NAMES LATIN2',$conn);
$strSQLszam = "select count(1) from shopcategories_node_status sns where sns.parent_='".$_REQUEST["subkey"]."'";
$rs_rekord = CustomQuery($strSQLszam);
$data_rekord = db_fetch_numarray($rs_rekord);
if ($data_rekord[0] > 0)
{
$strSQL = "select * from shopcategories_node_status sns where sns.parent_='".$_REQUEST["subkey"]."'";
$rs = db_query($strSQL,$conn);
$termek_menu.="<center>Katergóriák:</center><div class=\"styled-select\">";
$termek_menu.= "<select size=\"10\" onchange=\"window.location.href=this.options[this.selectedIndex].value;\">\n";
while ($data = db_fetch_array($rs))
{
$termek_menu.="<option ".(($data["Category_id"] == $_REQUEST["value111"]) ? "selected":"")." value=\"shopinventory_list.php?subkey=".$_REQUEST["subkey"]."&subkey2=".$data["Category_id"]."&alkat=a&ctlSearchFor=&srchOptShowStatus=0&ctrlTypeComboStatus=0&srchWinShowStatus=0&a=integrated&id=1&criteria=and&value11=".htmlspecialchars(rawurlencode($data["Category_id"]))."&value111=".htmlspecialchars(rawurlencode($data["Category_id"]))."&field1=Category_id&option1=Equals\">".$data["Category_class"]."</option>\n";
}
$termek_menu.="</select>";
$termek_menu.="</div>";
}
?>