:: Forum >>

How to add keyboard event onkeyUp/onkeyDown to list items in grid

Hi Alex,

Please help me on this i went back and tried _actions.js and _single.js as you suggested but no use this is really bugging me

My main problem is that i can't get 'i ' (selected index)value
My code goes like below
case 'combo':
combo = new AW.Templates.Combo;
this.obj.setCellTemplate(combo, m);
var self = this;
this.obj.setPopupTemplate(function(col, row){
var grid = this;

var list = new AW.UI.List;
labels = changeComboCodes(col, row);

list.onItemMouseOver = function(event, i){iVal=i; return list.getItemTemplate(i).setStyle("background", "#ccc")}; //works fine

list.onItemMouseDown= function(event, i){return list.getItemTemplate(i).setStyle("background", "#999")};//works fine

list.onItemMouseOut = function(event, i){ iVal=i; return list.getItemTemplate(i).setStyle("background", "#fff")};//works fine

//Here is where i want to add keyboard event
list.onItemKeyUp= function(event,i){ //
alert(i)//return undefined ( i tried declaring in _single file and calling relevant function no result found)

//below code works fine
list.onItemClicked = function(event, i){
var text = this.getItemText(i);
grid.setCellText(labels[i], col, row);
grid.setCellValue(values[i], col, row);
grid.getCellTemplate(col, row).hidePopup();
return list;

In /source/lib/ui/_sungle.js

//I have added both
onItemKeyUp: "gotoPreviousItem", // 'i' is undefined in these case
onItemKeyDown: "gotoNextItem",

onKeyUp: "gotoPreviousItem",//this works for grid rows not for list item
onKeyDown:"gotoNextItem",//this works for grid rows not for list item
onItemClicked:"selectClickedItem"//works fine


gotoPreviousItem: f(go, previous),
gotoNextItem: f(go, next),

Please help me on this
Tuesday, December 18, 2007
Pls anybody comment on this
Wednesday, December 26, 2007

This topic is archived.

Back to support forum

Forum search