Forum


07:39

21/01/2012

Hi,
I've a gird with a search form enabled, one of the search conditions is a select that is filled from the server, the problem is that the first time that this select is filled and I send the query to the server, on the other side I get 'null' instead of the select's value, but, if I change to another value, and also, if I return to the first one all works fine.
what do I doing wrong?,
regards
10:40

Moderators
30/10/2007

Hello,
The simple check is - please see what is your code when you buil the select. See what data is sended from server when the select is build
Regardas
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
01:59

21/01/2012

Hi,
The PHP code is:
---
$db->exec_query("select * from gnm_unit");
$select = "<select>";
while( $row = $db->fetch_data() )
{
$selected = ( $row["id"] == "KGS" ) ? "selected" : "";
$select .= "<option value="". $row["id"] ."" {$selected}>". $row["name"] ."</option>";
}
$select .= "</select>";
//send response to ajax
header("Content-Type: text/html");
echo $select;
and it sends to the client:
---
<select><option value="KGS" selected>KGS</option><option value="LTS" >LTS</option><option value="UNO" >UNO</option></select>
Every is fine, well, I suppose, I have other selects declared into the Search Form except that these don't get data from server, they take them from ColModel as follow:
{name:"enabled", index:"enabled", width:100, align:"center", editable:true, search:true, formatter:"checkbox", edittype:"checkbox", stype:"select", editoptions:{value:"1:0",defaultValue:"1"}, searchoptions:{value:{0:$.security.grid.personal.disabled,1:$.security.grid.personal.enabled}, sopt:['eq']}}
//text vars
$.security.grid.personal.disabled = "Disabled";
$.security.grid.personal.enabled = "Enabled";
These last "selects" work fine, they dont send 'null' when the "select" is built.
best regards
Most Users Ever Online: 715
Currently Online:
59 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66