:: Forum >>
Updating Grid Cells From Child Window
I am struggling to update a cell in an AW.GRID on a parent window from a child window. I can update the innerHTML element of the <span> tag but if you edit the cell, you loose the value posted.
This is my attempt to pass a value back (Col and roware the col and row numbers that I passed to the child window via $_GET)
[code[opener.document.getElementById('aw37-cell-'+col+'-'+row).innerHTML = test;[/code]
This works and puts the text into the cell but I can do noting with it??
opener.document.getElementById('aw37-cell-'+col+'-'+row).value = test;
This doesnt
opener.document.getElementById('aw37-cell-'+col+'-'+row).setCellText() = test;
This doesnt
opener.document.getElementById('aw37-cell-'+col+'-'+row).setCellText(test,col,row);
This doesnt
Please help
Jez (True Track Software)
Friday, January 14, 2011
I am by no means an expert - but anytime i have to do grid updates i always use a reference to the grid and update both my data array (since thats what im using) as well as in some cases it requires a setCellText.
...
gridref.gridData[row][col]=codeval;
gridref.setCellText(codeval,col,row);
...
Now - none of this may be news to you, but if you are already passing col & row to the child window - why not also pass a variable that is a reference to the grid?
If you cant pass that reference - theres a way to get the grid reference from other information.
Ben W (ScheduleForce)
Monday, January 17, 2011
Thanks for your advice any help is always appreciated.
I spent hours delving into the DOM of the grid and managed to update the INPUT but in the end it was very simple once I realised that you can use the AW built in functions of the parent Object as follows: -
AW.INPUT
OBJ = the parent window AW.INPUT (var OBJ = new AW.UI.Input;)
window.opener.OBJ.setControlText(value);
AW.GRID
OBJ = the parent window AW.GRID (var OBJ = new AW.UI.Grid;)
window.opener.obj.setCellText(value,1,0);
Jez (True Track Software)
Tuesday, January 18, 2011
This topic is archived.
Back to support forum
Forum search