tags:

views:

13

answers:

1

Hello,

I'm building a grid in a php file. Some fields are displayed as images. To do so, i use something like that (here is a example for one field):

...
$grid->setColProperty("sample_global", array("label"=>"Sample", editable"=>true,"edittype"=>"select","editoptions"=>array("value"=>"0:Container;1:Automatic sampler;2:Transporting system;3:Global mixing sample;4:Somewhere..."),"editrules"=>array("number"=>true,"required"=>true)));
...
$myevent = <<<ONSELECT
function(rowid, rowdata){
    switch (rowdata.sample_global) {
      case '0': $("#grid_control_analyses").jqGrid('setCell',rowid,'sample_global',"<img src='echantillon_0.png' />",''); break;
      case '1': $("#grid_control_analyses").jqGrid('setCell',rowid,'sample_global',"<img src='echantillon_1.png' />",''); break;
...
    }
...

The images for this field are well displayed in the grid ! And when i edit a record, the select list tag appear...

BUT i get the following problem: the select list tag is not initialized with the right value, but always with the first value of the list. In other words, if in the grid i have for a record the image named "echantillon_1.png" (that is to say the value "1" equals to "Automatic sampler"), when i edit it, the select list tag is not set with the second item of the list, but with the first one ("Container") !

How to solve this initialization problem in the edition mode ?

Regards, Qualliarys

A: 

... normally that will be manageable in the next jqgridPHP release !

Qualliarys