:: Forum >>

Pre-populate cell upon editting

I have a grid with some cells that are formatted as AW.Formats.Date. I need to make it so that when a user starts to edit one of these cells, if there is no data in that cell, the cell gets populated with today's date.

I'm going to guess there's an event something along the lines of "onCellBeginEditting" or the like, such that I could do:

myGrid.onCellBeginEditting = function(){
if(!this.value) {this.value=date_string;}
}

(or something kind of similar to the above)

I checked the Grid Class Reference, but I don't see where I would be able to look up information about this, or see if such an event exists already, etc...

Could someone point me in the right direction here?
John
Tuesday, March 16, 2010
And if only I had dug a bit deeper. Sorry about that, found what I was looking for:

http://www.activewidgets.com/aw.ui.grid/cell-edit-events.html
John
Tuesday, March 16, 2010
For completeness sake, posting this here:

myGrid.onCellEditStarted = function(text,column,row){
if(text == "" && myGrid.getCellFormat(column,row)==date_format){
myGrid.setCellText(date_string,column,row);
}
}
//date_string is a string representing today's date.
//date_format is the format object that is applied to all the date cells.
John
Tuesday, March 16, 2010

This topic is archived.


Back to support forum

Forum search