You can use OptionsConnector for grid in the same way. There is no need to define extra linking on client side. Using something like next on server side is enough
It partly decided problem. Thank you. But I need solution somthing like set_options of set_options or filter of set_options. Other words, I need to load data to “coro” cell depending of row id.
the current code:
$options = new OptionsConnector($res,“MySQL”);
$options->render_sql(“select id as value, name as label, prop_id from measure”,“id”,“id(value),name(label)”); // here I played with sql “where prop_id=…” . it is not apropriate as dara selection will be correct for only some rows.
$conn = new GridConnector($res,“MySQL”);// connector initialization
$conn->set_options(“measure”,$options);
$conn->render_sql(“select * from obj_prop where str_id=$str_id”,“id”, “prop_id, prop_name, measure, value, cls_id, str_id”);
Unfortunately there is no way to produce the necessary xml structure with PHP connector. Existing options generator can generate options collection once for all grid only.
You can use dataprocessor or serialize data back to XML
In case of dataprocessor, you can use ready handlers that can save data to the target DB, or define your own server side handlers that will receive data each time as record in the grid was changed, added or removed.
$uffici = new OptionsConnector($db,“MySQLi”); // ADDED
$uffici->render_table(“uffici”,“id”,“id(value),nomeCompleto(label)”); // ADDED
$grid = new GridConnector($db,“MySQLi”);
$grid->set_options(“idUfficio”, $uffici); // ADDED
$grid->render_table(“ufficiPreferiti”,“id”,“idUfficio,idRegistro,idUtente”);
[/code]
On server side, I get the same xml result with and without the lines marked with “ADDED” - i.e. I get only the xml of the grid data, without any options data.
On client side, with the following code, I see no difference either, I see the id in the combo column (idUfficio), not the label/name (uffici.nomeCompleto)