Hi guys,
I have a main grid and a grid below it.
I would like to update the main grid in Excel mode, but if I set cellEdit = true I can’t call the rows connected in the subgrid; on the other hand if I set cellEdit = false I can get the lines connected in the subgrid but I can’t update the main grid in the excel view.
There is a solution?
Thanks in advance
Massimo Gagliardi
On master grid with id ‘list1’ you can set:
$opt[“cellEdit”] = true;
$opt[“onSelectCell”] = “function(rowid){ jQuery(‘#list1’).setSelection(rowid,true); }”;
//…
$g->set_options($opt);
This way, on each cell select event of excel mode, it will invoke row selection of master and update detail grid.
I work with the version 2.1.2 build.
There isn’t “onSelectCell” in this version.
There is anything of similar?
Thanks in advance
onSelectCell should work on your version as well. You can try putting alert(); statement inside callback and see if it is calling.
Also check debug console f12 for possible js errors.
If still not resolved, share code for review.
This is a slice of my program:
$grid[“detail_grid_id”] = “list2”;
$grid[“subgridparams”] = “Groupage”;
$grid[“footerrow”] = true;
$grantpdf = $grantadd = $grantdel = false;
$grid[“scroll”] = true;
$grid[“cellEdit”] = true; // inline cell editing, like spreadsheet
$grid[“onSelectCell”] = ”
function(rowid) {
alert(‘YES’);
$(‘#list1’).setSelection(rowid, true);
}”;
$grid[“rownumbers”] = true;
$grid[“rownumWidth”] = 30;
…
$g->set_options($grid);
$e[“on_data_display”] = array(“filter_display”, null, true);
$e[“on_export”] = array(“custom_export”, null, true);
$e[“js_on_load_complete”] = “do_onload”;
$g->set_events($e);
….
Nothing alert, nothing error (F12), but, incredible, with the right button of mouse, also if this isn’t the solution, it works!
I don’t know how doing.