3.2.0

Return to same cell after table.request();

Alex and everyone:

I have a grid with 22 columns, about 8 of which can actually be displayed on the screen at one time (along with 12 rows...the number of rows will be dynamic, the number of columns is set).

Every time a value in a cell is changed I send the value, the column number and the row number to a file that makes the necessary adjustments and updates the xml file that contains the contents displayed in the grid using obj.onCellValidated.

I have been trying to figure out how to get the grid to "focus" on the cell that was just edited after the refresh instead of shifting back to the extreme left and top.

Here is the code I am using inside obj.onCellValidated, as you can see I have the column and row number available to me.

obj.onCellValidated = function(text, column, row){

var r = new AW.HTTP.Request;
r.setURL("/controller/cellManager.php");
r.setRequestMethod("POST");
r.setParameter("column", column);
r.setParameter("row", row);
r.setParameter("text", text);
r.setParameter("ajaxMode", 'cellUpdate');
r.setParameter("xmlFile", '<? echo $_REQUEST[xmlFile]; ?>');
r.request();

r.response = function(data){

if (data.indexOf('NOTICE') !=-1){
alert(data);
}

obj.clearCellModel();
obj.setCellModel(table);
obj.setCellEditable(true);

var d = new Date();
table.setURL("/xmlFiles/<? echo $_REQUEST['xmlFile']; ?>?"+d.getTime());
table.request();
jumpToCell(column);
//obj.setScrollTop(50);

}
}

Any help or information would be greatly appreciated
Paul M
July 9,

This topic is archived.

See also:


Back to support forum