:: Forum >>
Disable listitem
Hi there,
Does any one know if ther's a possibility to 'disable' a listitem?
I'm using it to make the following menu and i want to disable listitems 0, 6, 14 17 and 20.
Here's my code
<style>
#myList {width: 100px; height: 99%;
border: 1px solid steelblue; background-color: #f2f2f2;
font-size: 8pt; font-family: Verdana,Arial,Univers,Helvetica}
#myList .aw-list-item {height:17px}
#myList .aw-mouseover-item {background: #ccc;}
#myList .aw-mousedown-item {background: #999;}
#myList .aw-items-selected {background: steelblue;}
#myList-item-0 {color: steelblue; font-weight: bold;}
#myList-item-6 {color: steelblue; font-weight: bold; }
#myList-item-14 {color: steelblue; font-weight: bold; }
#myList-item-17 {color: steelblue; font-weight: bold; }
#myList-item-20 {color: steelblue; font-weight: bold; }
#myList-item-22 {color: steelblue; font-weight: bold; }
</style>
<script>
window.focus();
</script>
<script>
var obj = new AW.UI.List;
obj.setId("myList");
obj.setItemText(["BASICS",
"- DDOs",
"- Contries",
"- Segments",
"- Sexes",
"- Titles",
"RELATIONS",
"- Organisation",
"- Status",
"- Thankings",
"- Kind",
"- Persuasion",
"- Status wbp",
"- Postfrequency",
"ADOPTIONS",
"- Projects",
"- Filestatus",
"REPORTS",
"- Reporttype",
"- Reportstatus",
"SYSTEM",
"- Users",
"GROUPS",
"- Manage" ]);
obj.setItemCount(24);
document.write(obj);
Johan Glas
Tuesday, February 26, 2008
Currently the list items do not have 'disabled' property. If you want to disable item selection you can make it jump to the next one -
obj.onCurrentItemChanged = function(i){
var disabled = {
0: true,
6: true,
14: true,
17: true,
20: true,
22: true
}
if (disabled[i]) {
this.setTimeout(function(){
var next = Number(i)+1;
this.setSelectedItems([next]);
this.setCurrentItem(next);
});
}
}
Alex (ActiveWidgets)
Thursday, February 28, 2008
This topic is archived.
Back to support forum
Forum search