Hi
Is it possible to query a table of data with pipe delimited fields, then break that field into an array for the dropdown specifically for the row being referred to ? apart from using a SQL lookup for each row. ?
Or is it possible to refer to a field value in a column formatter?
Example is I have multiple values against a record, I want users to choose the correct value for each row.
Hi,
Please refer to this code:
https://gist.github.com/gridphp/53485c7be70df244d950fc36e810a01d
Step1, line 32-47: Makes tab separated value to dropdown required format
Step2, line 49-59: Makes a dropdown from the other field of the row
Step3, line 61-65: Make options non editable so it does not disturb step1.
All working – just had to add $col[“editable”] = true; to get the dropdown to work.
$col = array();
$col[“title”] = “Answer”;
$col[“name”] = “answer”;
$col[“width”] = “100”;
$col[“edittype”] = “select”;
$col[“editable”] = true;
$col[“editoptions”][“value”] = “function(elem){
var grid = $(‘#list1’);
var r = grid.getGridParam(‘selrow’);
return grid.jqGrid(‘getCell’, r, ‘options’);
}”;
$cols[] = $col;