How to change list items color on onmouseover and onmouseOut and adding scroll bar
Hi
In the following code i am generating list in gridcell for this i want to add
color to dropdown list on onmouseover and onmouseOut pls help me how to do this
and also i want to add scroll bars(both horizontal and vertical)
combo = new AW.Templates.Combo;
combo.setItemText(fetchComponentDataFromRemote(colList[m].dataHook));
this.obj.setCellTemplate(combo, m);
var self = this;
this.obj.setPopupTemplate(function(col, row){
var grid = this;
var list = new AW.UI.List;
var labels = self.getComboTextLabels(col);
var plabels = labels;
var values = self.getComboValues(col);
list.setItemText(plabels);
list.setItemCount(plabels.length);
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;
});
I have added the onmouseover and onmouseout events to list control as above now i want to impliment keyboard events like enter/pagedown/pageup to select list items using keyboard i tried
list.onItemClicked = function(event, i){
alert(i) //works fine
}
I tried setting events like below
list.setEvent('onKeyPageUp',onKeyUp ); //event not triggers
list.setEvent('onKeyPageDown', onKeyPage);//event not triggers
try to call respective functions not working please help me
I saw another post on the same but no reply
Please answer to this!!
Thanks in advance
sufiya
Friday, October 26, 2007
Alex,
Please help me on the same!!
Regards
Sufiya
sufiya
Saturday, October 27, 2007
Look at how the list keyboard navigation is implemented -
/source/lib/ui/_actions.js
Single selection controller -
/source/lib/ui/_single.js
Multiple selection -
/source/lib/ui/_multi.js
Alex (ActiveWidgets)
Tuesday, October 30, 2007
Alex,
Well I have tried like below no result I don't see list.onItemMouseOver /list.onItemMouseOut events registered in any of the above files you mentioned but i was just trying i got it working fine !
In _actions .js
function next(){
var i = this.getCurrentItem();
alert(i)//this i is always 0
var p = Math.min(this.getViewPosition(i) + 1, this.getViewOffset() + this.getViewCount() - 1);
var a = this.getViewIndices();
return a ? a[p] : p;
}
//.js file i tried like below
list.onKeyDown = function (event,i){
alert("i"+i);//i gives undefined
}
list.onKeyUp = function (event,i){
alert("i"+i);//i gives undefined
}
list.onItemClicked = function(event, i){
alert("text->"+i) //Gives currect index works fine
var text = this.getItemText(i);
grid.setCellText(labels[i], col, row);
grid.setCellValue(values[i], col, row);
grid.getCellTemplate(col, row).hidePopup();
}