/* exported VQRSelectableList */ var VQRSelectableList=new Class({ Implements: [Events, Options], container:null, lists:[], nEl:0, selected:-1, currentOrder:[], options:{ classCSS:[{ width:null, list:null, itemList:null, container:null, selectedItem:null }], doubleClickFunc:null, clickFunc:null, nList:1, scroll:false }, keyboard:null, listElements:[], stringElementList:[], initialize:function(container,options){ this.setOptions(options); this.container=document.id(container); if (Browser.ie && Browser.version<9) this.container.style.overflow='auto'; if (this.options.nList>1){ for (var i=0; i40){ while (tmpTitle!=''){ title+=tmpTitle.substring(0,40)+'\n'; tmpTitle=tmpTitle.substring(40); } } else title=itemList[i]; var li=new Element('li',{ html:itemList[i]||' ', title:title, index:index, styles:{ 'MozUserSelect':'none', 'width':'100%', 'text-overflow':'ellipsis', '-o-text-overflow':'ellipsis', 'white-space':'nowrap', 'overflow':'hidden' } }).inject(this.lists[i]); this.listElements[i].push(li); if (this.options.classCSS[i]) li.addClass(this.options.classCSS[i].itemList) } if (this.currentOrder.length==index) this.currentOrder[index]=index; if (refresh) this.refresh(); }, addStringRow:function(itemList/*,refresh*/){ // prepara una stringa contenente gli elementi ul per poi fare un innerhtml alla fine this.nEl++; var index=this.nEl-1; for (var i=0; i40){ while (tmpTitle!=''){ title+=tmpTitle.substring(0,40)+'\n'; tmpTitle=tmpTitle.substring(40); } } else title=itemList[i]; if (this.options.classCSS[i]) this.stringElementList[i]+="
  • "+(itemList[i]||' ')+"
  • "; else this.stringElementList[i]+="
  • "+(itemList[i]||' ')+"
  • "; } if (this.currentOrder.length==index) this.currentOrder[index]=index; }, addRows:function(){ //fa l'innerHTML delle stringhe preparate in precedenza for (var i=0; i=0 && index-1){ if (this.options.classCSS[i].selectedItem) childList[this.selected].removeClass(this.options.classCSS[i].selectedItem) } if (this.options.classCSS[i].selectedItem) childList[index].addClass(this.options.classCSS[i].selectedItem) } this.selected=index; if ((childList0[index].getPosition().y+childList0[index].getSize().y) > (this.container.getPosition().y+this.container.getSize().y)) new Fx.Scroll(this.container).toElement(childList0[index],'y') else if ((childList0[index].getPosition().y) < (this.container.getPosition().y)) new Fx.Scroll(this.container).toElement(childList0[index],'y') if (this.options.clickFunc) this.options.clickFunc(); } this.keyboard.activate() }, setSelectRow2:function(idx){ var index=this.currentOrder.indexOf(this.selected); if (index!=-1){ if (((index+idx)>=0) && ((index+idx) b.innerText.toUpperCase() ? 1 : -1; }); for (let j=0; j < orderedNodes[index].length; j++) { let rowIndex = orderedNodes[index][j].getAttribute('index'); for (let i=0; i