3.0.0

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;
});

Thanks in Advance
Sufiya Khan
sufiya
June 28,
Guys

I found the solutions

list.onItemMouseOver = function(event, i){ return list.getItemTemplate(i).setStyle("background", "#ccc")};
list.onItemMouseDown= function(event, i){return list.getItemTemplate(i).setStyle("background", "#999")};
list.onItemMouseOut = function(event, i){ return list.getItemTemplate(i).setStyle("background", "#fff")};
sufiya
October 26,
Hi Alex,

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.onKeyEnter = function(event, i){ // event triggers
alert(event) // gives object
alert(i) //returning null
}

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
October 26,
Alex,

Please help me on the same!!

Regards
Sufiya
sufiya
October 27,
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)
October 30,
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();
}

return list;
});
sufiya
October 31,
Alex,

Pls throw some light on this

Regards
Sufiya
November 13,

This topic is archived.

See also:


Back to support forum

Search

Version 2

Looking for AW 2.6 ?
The old site is here.