📄 treegrid.js
字号:
cols=profile.colMap,
col,
sid,
cells,
n=[];
if(col=cols[sid=map[colId]]){
n.push(profile.getSubNode('HCELL',sid).get(0));
_.each(col._cells,function(id){
n.push(profile.getSubNode('CELL',id).get(0));
});
linb(n).css('display',(col.visibility=(flag===false?false:true))?'':'none');
}
});
}
},
Initialize:function(){
this.addTemplateKeys(['ALT','PROGRESS']);
},
Static:{
Templates:{
tagName : 'div',
style:'{_style}',
BORDER:{
tagName : 'div',
BOX:{
tagName:'div',
HEADER:{
$order:0,
tagName:'div',
style:"{showHeader}",
//for scroll performance
HI:{
tagName:'div',
style:'width:10000px;',
HCELLS:{
tagName:'div',
style:'height:{headerHeight}px;',
/*the first col (row handler) in table header*/
HCELL0:{
$order:0,
style:'{rowHandlerDisplay};width:{_row0DfW}px;',
HCELL0A:{
HHANDLER:{
tagName:'div',
style:'{colDDDisplay}'
},
ROWHANDLER:{
tagName:'div',
style:'{rowDDDisplay}'
}
}
},
OTHERHCELLS:{
$order:1,
tagName:'text',
text:'{header}'
}
}
}
},
SCROLL:{
$order:1,
tagName:'div',
className:'ui-content ',
BODY:{
tagName:'div',
text:'{rows}'
}
},
FOOTER:{
$order:2
},
COLLIST:{
tagName:'div'
}
}
},
$dynamic : {
/*the other header in table header*/
header:{
HCELL:{
className:'{headerClass}',
style:"width:{width}px;{headerStyle}",
HCELLA:{
text:"{caption}",
SORT:{
style:'{sortDisplay}'
},
HHANDLER : {
$order:2,
tagName:'div',
style:'{colDDDisplay}'
}
}
}
},
rows:{
ROW:{
tagName:'div',
PREVIEW:{
$order:1,
tagName:'div',
style:'{previewDisplay}',
text:'{preview}'
},
CELLS:{
$order:2,
tagName:'div',
className:'{rowCls} {rowClass}',
style:'height:{rowHeight}px;{rowStyle}',
FIRSTCELL:{
$order:0,
style:'{rowHandlerDisplay};width:{_row0DfW}px;',
FIRSTCELLA:{
TOGGLE:{$order:1,
className:'uicmd-toggle',
style:'{display}'
},
ROWHANDLER:{
tagName:'div',
style:'{rowDDDisplay}'
},
FIRSTCELLNO:{
text:' '
}
}
},
OTHERCELLS:{
tagName:'text',
$order: 1,
text:'{caption}{cells}'
}
},
SUB:{
$order:3,
tagName:'div'
},
SUMMARY:{
$order:4,
tagName:'div',
style:'{summaryDisplay}',
text:'{summary}'
}
}
},
'rows.cells':function(profile,template,v,tag,result){
var me=arguments.callee,map=me._m||(me._m={'checkbox':'.checkbox','button':'.button','progress':'.progress'});
linb.UI.$doTemplate(profile,template,v,tag+(map[v.type]||'.input'),result)
},
'rows.cells.input':{
CELL:{
style:'width:{width}px;{cellDisplay};{cellStyle}',
className:'{cellCls} {cellClass}',
CELLA:{
tagName:'a',
style:'{bgcolor};{color};',
href :linb.$href,
tabindex: '{_tabindex}',
text:"{caption}"
}
}
},
'rows.cells.button':{
CELL:{
style:'width:{width}px;{cellDisplay};{cellStyle}',
className:'{cellCls} {cellClass}',
CELLA:{
tagName:'button',
tabindex: '{_tabindex}',
text:"{caption}"
}
}
},
'rows.cells.checkbox':{
CELL:{
style:'width:{width}px;{cellDisplay};{cellStyle}',
className:'{cellCls} {cellClass}',
CELLA:{
tagName:'a',
href :linb.$href,
tabindex: '{_tabindex}',
CHECKBOX:{
className:'{checkboxCls}'
}
}
}
},
'rows.cells.progress':{
CELL:{
style:'width:{width}px;{cellDisplay};{cellStyle}',
className:'{cellCls} {cellClass}',
CELLA:{
tagName:'a',
href :linb.$href,
tabindex: '{_tabindex}',
PROGRESS:{
tagName:'div',
style:'width:{progress};',
text:'{caption}'
}
}
}
}
}
},
Appearances:{
KEY:{
//in firefox, a can focused with display:block
display:'block',
position:'absolute',
overflow:'hidden'
},
BOX:{
display:'block',
position:'relative',
overflow:'hidden'
},
HEADER:{
background: linb.UI.$bg('head.gif', ' #EBEADB repeat-x left bottom'),
position:'relative',
overflow:'hidden'
},
HI:{
position:'relative'
},
SCROLL:{
overflow:'auto',
position:'relative'
},
COLLIST:{
position:'absolute',
'z-index':'10',
left:0,
top:0,
cursor:'pointer',
visibility:'hidden',
background: linb.UI.$bg('collist.gif', ' #EBEADB no-repeat center bottom'),
border:'1px solid',
'border-color': '#fff #ACA899 #ACA899 #fff'
},
BODY:{
overflow:'visible',
position:'absolute',
'background-color':' #fff',
left:0,
top:'0',
'font-size':0,
'line-height':0,
'border-bottom': '1px solid #ACA899'
},
'SORT, SORT-checked':{
width:'15px',
height:'15px'
},
SORT:{
background: linb.UI.$bg('cmds.gif', ' no-repeat -191px top', true),
position:'absolute',
right:'2px',
bottom:'2px'
},
'HCELL-mouseover SORT':{
$order:1,
'background-position': '-191px -15px'
},
'HCELL-mousedown SORT':{
$order:2,
'background-position': '-191px -30px'
},
'SORT-checked':{
$order:3,
'background-position': '-206px top'
},
'HCELL-mouseover SORT-checked':{
$order:4,
'background-position': '-206px -15px'
},
'HCELL-mousedown SORT-checked':{
$order:5,
'background-position': '-206px -30px'
},
HHANDLER:{
position:'absolute',
//if set z-index, disappearing in opera
//'z-index':'10',
background: linb.browser.ie?'url('+linb.ini.file_bg+')':null,
width:'4px',
top:'0',
right:'0',
height:'100%',
cursor:'e-resize',
'font-size':0,
'line-height':0
},
'HCELLS, CELLS':{
//for ie6 height change trigger
'overflow-y': linb.browser.ie6 ?'hidden':'',
position:'relative',
'white-space': 'nowrap',
'font-size':'12px',
'line-height':'18px'
},
HCELLS:{
'padding-bottom':'2px'
},
'CELLS-group':{
$order:1,
'font-weight':'bold',
color:'#3764A0',
'border-right': '1px solid #ACA899'
},
'PREVIEW,SUMMARY':{
position:'relative',
display:'none',
'padding-left':'16px',
'border-right': '1px solid #ACA899'
},
PREVIEW:{
'border-bottom': '1px dashed #ACA899'
},
SUMMARY:{
'border-top': '1px dashed #ACA899'
},
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -