<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>The source code</title>
<link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="../resources/prettify/prettify.js"></script>
</head>
<body onload="prettyPrint();">
<pre class="prettyprint lang-js">/*!
* Ext JS Library 3.3.1
* Copyright(c) 2006-2010 Sencha Inc.
* licensing@sencha.com
* http://www.sencha.com/license
*/
Ext.ns('Ext.ux.grid');
/**
* @class Ext.ux.grid.BufferView
* @extends Ext.grid.GridView
* A custom GridView which renders rows on an as-needed basis.
*/
Ext.ux.grid.BufferView = Ext.extend(Ext.grid.GridView, {
<div id="cfg-Ext.ux.grid.BufferView-rowHeight"></div>/**
* @cfg {Number} rowHeight
* The height of a row in the grid.
*/
rowHeight: 19,
<div id="cfg-Ext.ux.grid.BufferView-borderHeight"></div>/**
* @cfg {Number} borderHeight
* The combined height of border-top and border-bottom of a row.
*/
borderHeight: 2,
<div id="cfg-Ext.ux.grid.BufferView-scrollDelay"></div>/**
* @cfg {Boolean/Number} scrollDelay
* The number of milliseconds before rendering rows out of the visible
* viewing area. Defaults to 100. Rows will render immediately with a config
* of false.
*/
scrollDelay: 100,
<div id="cfg-Ext.ux.grid.BufferView-cacheSize"></div>/**
* @cfg {Number} cacheSize
* The number of rows to look forward and backwards from the currently viewable
* area. The cache applies only to rows that have been rendered already.
*/
cacheSize: 20,
<div id="cfg-Ext.ux.grid.BufferView-cleanDelay"></div>/**
* @cfg {Number} cleanDelay
* The number of milliseconds to buffer cleaning of extra rows not in the
* cache.
*/
cleanDelay: 500,
initTemplates : function(){
Ext.ux.grid.BufferView.superclass.initTemplates.call(this);
var ts = this.templates;
// empty div to act as a place holder for a row
ts.rowHolder = new Ext.Template(
'<div class="x-grid3-row {alt}" style="{tstyle}"></div>'
);
ts.rowHolder.disableFormats = true;
ts.rowHolder.compile();
ts.rowBody = new Ext.Template(
'<table class="x-grid3-row-table" border="0" cellspacing="0" cellpadding="0" style="{tstyle}">',
'<tbody><tr>{cells}</tr>',
(this.enableRowBody ? '<tr class="x-grid3-row-body-tr" style="{bodyStyle}"><td colspan="{cols}" class="x-grid3-body-cell" tabIndex="0" hidefocus="on"><div class="x-grid3-row-body">{body}</div></td></tr>' : ''),
'</tbody></table>'
);
ts.rowBody.disableFormats = true;
ts.rowBody.compile();
},
getStyleRowHeight : function(){
return Ext.isBorderBox ? (this.rowHeight + this.borderHeight) : this.rowHeight;
},
getCalculatedRowHeight : function(){
return this.rowHeight + this.borderHeight;
},
getVisibleRowCount : function(){
var rh = this.getCalculatedRowHeight(),
visibleHeight = this.scroller.dom.clientHeight;
return (visibleHeight < 1) ? 0 : Math.ceil(visibleHeight / rh);
},
getVisibleRows: function(){
var count = this.getVisibleRowCount(),
sc = this.scroller.dom.scrollTop,
start = (sc === 0 ? 0 : Math.floor(sc/this.getCalculatedRowHeight())-1);
return {
first: Math.max(start, 0),
last: Math.min(start + count + 2, this.ds.getCount()-1)
};
},
doRender : function(cs, rs, ds, startRow, colCount, stripe, onlyBody){
var ts = this.templates,
ct = ts.cell,
rt = ts.row,
rb = ts.rowBody,
last = colCount-1,
rh = this.getStyleRowHeight(),
vr = this.getVisibleRows(),
tstyle = 'width:'+this.getTotalWidth()+';height:'+rh+'px;',
// buffers
buf = [],
cb,
c,
p = {},
rp = {tstyle: tstyle},
r;
for (var j = 0, len = rs.length; j < len; j++) {
r = rs[j]; cb = [];
var rowIndex = (j+startRow),
visible = rowIndex >= vr.first && rowIndex <= vr.last;
if (visible) {
for (var i = 0; i < colCount; i++) {
c = cs[i];
p.id = c.id;
p.css = i === 0 ? 'x-grid3-cell-first ' : (i == last ? 'x-grid3-cell-last ' : '');
p.attr = p.cellAttr = "";
p.value = c.renderer(r.data[c.name], p, r, rowIndex, i, ds);
p.style = c.style;
if (p.value === undefined || p.value === "") {
p.value = " ";
}
if (r.dirty && typeof r.modified[c.name] !== 'undefined') {
p.css += ' x-grid3-dirty-cell';
}
cb[cb.length] = ct.apply(p);
}
}
var alt = [];
if(stripe && ((rowIndex+1) % 2 === 0)){
alt[0] = "x-grid3-row-alt";
}
if(r.dirty){
alt[1] = " x-grid3-dirty-row";
}
rp.cols = colCount;
if(this.getRowClass){
alt[2] = this.getRowClass(r, rowIndex, rp, ds);
}
rp.alt = alt.join(" ");
rp.cells = cb.join("");
buf[buf.length] = !visible ? ts.rowHolder.apply(rp) : (onlyBody ? rb.apply(rp) : rt.apply(rp));
}
return buf.join("");
},
isRowRendered: function(index){
var row = this.getRow(index);
return row && row.childNodes.length > 0;
},
syncScroll: function(){
Ext.ux.grid.BufferView.superclass.syncScroll.apply(this, arguments);
this.update();
},
// a (optionally) buffered method to update contents of gridview
update: function(){
if (this.scrollDelay) {
if (!this.renderTask) {
this.renderTask = new Ext.util.DelayedTask(this.doUpdate, this);
}
this.renderTask.delay(this.scrollDelay);
}else{
this.doUpdate();
}
},
onRemove : function(ds, record, index, isUpdate){
Ext.ux.grid.BufferView.superclass.onRemove.apply(this, arguments);
if(isUpdate !== true){
this.update();
}
},
doUpdate: function(){
if (this.getVisibleRowCount() > 0) {
var g = this.grid,
cm = g.colModel,
ds = g.store,
cs = this.getColumnData(),
vr = this.getVisibleRows(),
row;
for (var i = vr.first; i <= vr.last; i++) {
// if row is NOT rendered and is visible, render it
if(!this.isRowRendered(i) && (row = this.getRow(i))){
var html = this.doRender(cs, [ds.getAt(i)], ds, i, cm.getColumnCount(), g.stripeRows, true);
row.innerHTML = html;
}
}
this.clean();
}
},
// a buffered method to clean rows
clean : function(){
if(!this.cleanTask){
this.cleanTask = new Ext.util.DelayedTask(this.doClean, this);
}
this.cleanTask.delay(this.cleanDelay);
},
doClean: function(){
if (this.getVisibleRowCount() > 0) {
var vr = this.getVisibleRows();
vr.first -= this.cacheSize;
vr.last += this.cacheSize;
var i = 0, rows = this.getRows();
// if first is less than 0, all rows have been rendered
// so lets clean the end...
if(vr.first <= 0){
i = vr.last + 1;
}
for(var len = this.ds.getCount(); i < len; i++){
// if current row is outside of first and last and
// has content, update the innerHTML to nothing
if ((i < vr.first || i > vr.last) && rows[i].innerHTML) {
rows[i].innerHTML = '';
}
}
}
},
removeTask: function(name){
var task = this[name];
if(task && task.cancel){
task.cancel();
this[name] = null;
}
},
destroy : function(){
this.removeTask('cleanTask');
this.removeTask('renderTask');
Ext.ux.grid.BufferView.superclass.destroy.call(this);
},
layout: function(){
Ext.ux.grid.BufferView.superclass.layout.call(this);
this.update();
}
});// We are adding these custom layouts to a namespace that does not
// exist by default in Ext, so we have to add the namespace first:
Ext.ns('Ext.ux.layout');
<div id="cls-Ext.ux.layout.CenterLayout"></div>/**
* @class Ext.ux.layout.CenterLayout
* @extends Ext.layout.FitLayout
* <p>This is a very simple layout style used to center contents within a container. This layout works within
* nested containers and can also be used as expected as a Viewport layout
没有合适的资源?快使用搜索试试~ 我知道了~
ext 3.3.1 最新开源版本
共2000个文件
gif:2526个
html:780个
js:648个
4星 · 超过85%的资源 需积分: 18 25 下载量 161 浏览量
2011-04-03
09:56:12
上传
评论
收藏 13.83MB ZIP 举报
温馨提示
ExtJS是一种主要用于创建前端用户界面,是一个与后台技术无关的前端ajax框架。功能丰富,无人能出其右。无论是界面之美,还是功能之强,ext的表格控件都高居榜首。 此地址可下载ExtJS3.2中文说明 http://download.csdn.net/source/2993411 ExtJS可以用来开发RIA也即富客户端的AJAX应用,是一个用javascript写的,主要用于创建前端用户界面,是一个与后台技术无关的前端 ajax框架。因此,可以把ExtJS用在.Net、Java、Php等各种开发语言开发的应用中。ExtJs最开始基于YUI技术,由开发人员 JackSlocum开发,通过参考JavaSwing等机制来组织可视化组件,无论从UI界面上CSS样式的应用,到数据解析上的异常处理,都可算是一款不可多得的JavaScript客户端技术的精品。 在经过Beta和RC版测试之后,ExtJS 终于迎来了3.3最终版的发布,这是3.x版本分支一个重要的更新,给您带来了新的组件、特性以及性能的提升,当然也包括bug的修复,你可以直接在3.2基础上升级到这个版本,而不会有不兼容的情况出现。 Ext JS 3.3.1 已经发布,对表单,css,日期,Grid等做了超过20个bug修正和功能的增强.
资源详情
资源评论
资源推荐
收起资源包目录
ext 3.3.1 最新开源版本 (2000个子文件)
ext-all.css 136KB
ext-all.css 132KB
ext-all.css 132KB
ext-all.css 132KB
ext-all.css 132KB
ext-all-notheme.css 98KB
xtheme-access.css 40KB
xtheme-blue.css 38KB
xtheme-gray.css 38KB
yourtheme.css 37KB
xtheme-gray.css 37KB
xtheme-gray.css 37KB
silk.css 17KB
calendar.css 17KB
ux-all.css 17KB
desktop.css 13KB
grid.css 11KB
form.css 10KB
extjs.css 8KB
button.css 8KB
panel.css 8KB
tabs.css 7KB
grid.css 6KB
style.css 6KB
style.css 6KB
grid.css 6KB
grid.css 6KB
docs.css 6KB
docs.css 6KB
panel-reset.css 6KB
GroupTab.css 6KB
core.css 5KB
toolbar.css 5KB
feed-viewer.css 5KB
feed-viewer.css 5KB
layout.css 5KB
date-picker.css 5KB
tree.css 4KB
feed-viewer-access.css 4KB
menu.css 4KB
tree.css 4KB
form.css 4KB
window.css 3KB
tree.css 3KB
tree.css 3KB
button.css 3KB
print.css 3KB
print.css 3KB
toolbar.css 3KB
tasks.css 3KB
tabs.css 3KB
date-picker.css 3KB
editor.css 3KB
tabs.css 3KB
resizable.css 3KB
date-picker.css 3KB
date-picker.css 3KB
statusbar.css 3KB
form.css 3KB
tabs.css 3KB
forum.css 3KB
toolbar.css 3KB
toolbar.css 3KB
qtips.css 3KB
form.css 2KB
layout-browser.css 2KB
button.css 2KB
button.css 2KB
restful.css 2KB
img-org.css 2KB
panel.css 2KB
panel.css 2KB
slider.css 2KB
panel.css 2KB
window.css 2KB
menu.css 2KB
chooser.css 2KB
window.css 2KB
window.css 2KB
core.css 2KB
resizable.css 2KB
resizable.css 2KB
core.css 2KB
resizable.css 2KB
menu.css 2KB
list-view.css 2KB
core.css 1KB
RowEditor.css 1KB
box.css 1KB
box.css 1KB
box.css 1KB
box.css 1KB
menu.css 1KB
examples.css 1KB
organizer.css 1KB
Spinner.css 1KB
toolbars.css 1KB
bubble.css 1KB
ColumnNodeUI.css 1KB
layout.css 1KB
共 2000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
xtuul
- 粉丝: 4
- 资源: 4
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论1