atLoad : function() {
this.treeDiv=document.createElement("div");
- this.treeDiv.id=this.id;
this.treeDiv.className='ricoTree';
if (Rico.theme.treeContent) Rico.addClass(this.treeDiv,Rico.theme.treeContent);
+ var elem=Rico.$(this.id);
+ if (elem) {
+ this.setDiv(elem, { position: 'auto' });
+ } else {
+ this.treeDiv.id=this.id;
+ this.createContainer();
+ }
this.treeDiv.style.height=this.options.height;
this.treeDiv.style.width=this.options.width;
- this.createContainer();
this.content.className=Rico.theme.tree || 'ricoTreeContainer';
this.content.appendChild(this.treeDiv);
if (this.options.showCheckBox) {
this.buttonDiv.className='ricoTreeButtons';
if (Rico.getStyle(this.container,'position')=='absolute') {
var span=document.createElement("span");
- span.innerHTML=RicoTranslate.getPhraseById('treeSave');
+ span.innerHTML=Rico.getPhraseById('treeSave');
Rico.setStyle(span,{'float':'left',cursor:'pointer'});
this.buttonDiv.appendChild(span);
Rico.eventBind(span, 'click', Rico.eventHandle(this,'saveSelection'));
}
var span=document.createElement("span");
- span.innerHTML=RicoTranslate.getPhraseById('treeClear');
+ span.innerHTML=Rico.getPhraseById('treeClear');
Rico.setStyle(span,{'float':'right',cursor:'pointer'});
this.buttonDiv.appendChild(span);
this.content.appendChild(this.buttonDiv);
Rico.eventBind(span, 'click', Rico.eventHandle(this,'clrCheckBoxEvent'));
}
- this.close();
+ if (this.position == 'absolute') this.close();
},
setTreeDiv: function(divId) {