3.0 beta 2

Cell editing with Single Row selection


I tried to perform an example in which i have to edit some cells but a single row selection must be performed !
the method i have used:
-initiating the grid to a single-row selection
-at a double click the single cell selection is activated to perform editing
-at the cell editing validation i return to the single row selection

it works sometimes but other times multiple rows still selected !!

have you other ideas please !
Thanks :)
Helmus
August 10,
The trick is to set current column and current row before starting the edit because normally in row selection mode the current column is not set -

obj.onCellDoubleClicked = function(event, col, row){
    this.setCurrentColumn(col);
    this.setCurrentRow(row);
    this.raiseEvent("editCurrentCell", event, col, row);
};


Here is the full code -

var obj = new AW.UI.Grid;
obj.setCellData(function(col, row){return col + "." + row});
obj.setHeaderText("header");

obj.setColumnCount(10);
obj.setRowCount(10);

obj.setCellEditable(true);
obj.setSelectionMode("single-row");

obj.onCellDoubleClicked = function(event, col, row){
    this.setCurrentColumn(col);
    this.setCurrentRow(row);
    this.raiseEvent("editCurrentCell", event, col, row);
};

document.write(obj);
Alex (ActiveWidgets)
August 10,
thanks a lot !
it is working !
;)
Helmus
August 14,

This topic is archived.

See also:


Back to support forum

Search

Version 2

Looking for AW 2.6 ?
The old site is here.