Hello to all , Hello stworthy
I'm trying to find a solution to have the multiple Select in a combogrid , but server side
This is my solution but not work well:
this is js
$('#id_RS_to_search').combogrid({
panelWidth:500,
url: 'controller/search_snp.php?protocol=<?php echo $_SESSION['protocol'] ?>',
idField:'id_RS',
textField:'id_RS',
mode:'remote',
multiple: true,
fitColumns:true,
columns:[[
{field:'ck',checkbox:true},
{field:'id_RS',title:'id_RS',width:250},
{field:'snp_name_lab',title:'snp_name_lab',width:250}
]]
});
And this my php script
if (isset($_REQUEST['protocol'])){
if (isset($_REQUEST['q']) && (!empty($_REQUEST['q']))){
$polimorfismi =$_REQUEST['q']);
$array_polimorfismi=array();
$snp_app='';
$snp='';
#controllo se ho piĆ¹ polimorfismi selezionati
if (preg_match("/\,/", $polimorfismi)){
$array_polimorfismi=preg_split('/\,/',$polimorfismi);
$numero_polimorfismi_inseriti=count($array_polimorfismi);
}else{
$numero_polimorfismi_inseriti=1;
array_push($array_polimorfismi, $polimorfismi);
}
#genero in automatico le condizioni di ricerca
for ($i=0;$i<=$numero_polimorfismi_inseriti;$i++){
if (!empty($array_polimorfismi[$i])){
$app=$array_polimorfismi[$i];//." ".$snp_name_lab;
$snp_app= $snp_app." snps.id_RS LIKE '$app%'
OR snps.snp_name_lab LIKE '$app%' OR ";
$app="";
$snp_name_lab="";
}
}
$snp=substr($snp_app, 0, strlen($snp_app)-3);
$sql=" SELECT snps.id_RS, snps.snp_name_lab
FROM snps ,snps_protocol
WHERE snps_protocol.protocol='".$_REQUEST['protocol']."'
AND snps_protocol.id_rs=snps.id_rs
AND(".$snp.")";
#echo $sql;
}else{
$sql=" SELECT snps.id_RS, snps.snp_name_lab
FROM snps ,snps_protocol
WHERE snps_protocol.protocol='".$_REQUEST['protocol']."'
AND snps_protocol.id_rs=snps.id_rs
";
#echo $sql;
}
If I try to write two different value in the combogrid, using the ",", the result is that the combobox select only the last one...
Or if I try to selcet one and then only write my value, the result is that I have only the first value selected
Can u help me?
Thanks