Master Detail and Excel view

QuestionsMaster Detail and Excel view
Massimo Gagliardi asked 8 months ago

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

4 Answers
Abu Ghufran Staff answered 8 months ago

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.

_________________________
Abu Ghufran - Dev Team
PHP Grid Framework
 
Massimo Gagliardi answered 8 months ago

I work with the version 2.1.2 build.

There isn’t “onSelectCell” in this version.

There is anything of similar?

Thanks in advance

Abu answered 8 months ago

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.

Massimo Gagliardi answered 8 months ago

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.

Your Answer

17 + 16 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?