phpgrid in popup window

Questionsphpgrid in popup window
josep asked 10 years ago

I have a grid PHP grid on a main window
and I open a popup window using window.open in which there is a second grid PHPGRID.
Would need to modify the values of the grid from the popup window from the main window is it possible?

4 Answers
Abu Ghufran answered 10 years ago

You would need to use window.opener from new window to access parent.

http://www.codeproject.com/Articles/25388/Accessing-parent-window-from-child-window-or-vice

josep answered 10 years ago

It is precisely what I'm using and does not work for me.

In the main window I have the grid PHPGRID called materiales
In the popup window is the PHPGRID grid called resumen

What I need is to navigate through the grid of the main window
and update the data in the popup window grillla

the code I use is:

var filaresumen = 0;
for ( var i = 0; i< filas ; i++) {
var mater = jQuery('#materiales').jqGrid('getCell', i , 'COD_MATER');
window.opener.$('#resumen').jqGrid('setCell', filaresumen, 'MATER' , mater );
++filaresumen;
}

filas is the number of rows in the main window grrilla
COD_MATER is the title of the column of the grid that I want to update on the grid popup window

Abu Ghufran answered 10 years ago

2 suggestions …

1) If you are using this code in popup page & materiales grid is on parent, then … window.opener will be used with materiales not resumen.

window.opener.jQuery('#materiales')……

2) In get/sellCell, you need to pass column name set in $col["name"] as 3rd argument (not title).

Your Answer

15 + 17 =

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?