Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
易企天创
zui
提交
263a7ec2
Z
zui
项目概览
易企天创
/
zui
11 个月 前同步成功
通知
6
Star
0
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
37
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Z
zui
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
37
Issue
37
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
263a7ec2
编写于
8月 11, 2014
作者:
C
Catouse
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
* fixed height of head when fixed.
* update data when check status changed.
上级
92f0517d
变更
6
展开全部
隐藏空白更改
内联
并排
Showing
6 changed file
with
595 addition
and
20 deletion
+595
-20
dist/js/zui.js
dist/js/zui.js
+564
-4
dist/js/zui.lite.js
dist/js/zui.lite.js
+4
-4
dist/js/zui.lite.min.js
dist/js/zui.lite.min.js
+2
-2
dist/js/zui.min.js
dist/js/zui.min.js
+4
-4
docs/example/datatable.html
docs/example/datatable.html
+2
-1
src/js/datatable.js
src/js/datatable.js
+19
-5
未找到文件。
dist/js/zui.js
浏览文件 @
263a7ec2
此差异已折叠。
点击以展开。
dist/js/zui.lite.js
浏览文件 @
263a7ec2
/*!
* ZUI - v1.1.0 - 2014-08-
06
* ZUI - v1.1.0 - 2014-08-
11
* http://zui.sexy
* GitHub: https://github.com/easysoft/zui.git
* Copyright (c) 2014 cnezsoft.com; Licensed MIT
...
...
@@ -70,13 +70,13 @@ if (typeof jQuery === "undefined") { throw new Error("ZUI requires jQuery") }
Store
.
prototype
.
pageGet
=
function
(
key
,
defaultValue
)
{
var
val
=
this
.
page
[
key
];
return
(
defaultValue
!==
undefined
&&
val
===
null
)
?
defaultValue
:
val
;
return
(
defaultValue
!==
undefined
&&
(
val
===
null
||
val
===
undefined
)
)
?
defaultValue
:
val
;
};
/* Set page data */
Store
.
prototype
.
pageSet
=
function
(
objOrKey
,
val
)
{
if
(
$
.
isPlanObject
(
objOrKey
))
if
(
$
.
isPla
i
nObject
(
objOrKey
))
{
$
.
extend
(
true
,
this
.
page
,
objOrKey
);
}
...
...
@@ -129,7 +129,7 @@ if (typeof jQuery === "undefined") { throw new Error("ZUI requires jQuery") }
Store
.
prototype
.
get
=
function
(
key
,
defaultValue
)
{
var
val
=
this
.
deserialize
(
this
.
getItem
(
key
));
return
(
defaultValue
!==
undefined
&&
val
===
null
)
?
defaultValue
:
val
;
return
(
defaultValue
!==
undefined
&&
(
val
===
null
||
val
===
undefined
)
)
?
defaultValue
:
val
;
};
/* Get item key by index and deserialize it */
...
...
dist/js/zui.lite.min.js
浏览文件 @
263a7ec2
此差异已折叠。
点击以展开。
dist/js/zui.min.js
浏览文件 @
263a7ec2
此差异已折叠。
点击以展开。
docs/example/datatable.html
浏览文件 @
263a7ec2
...
...
@@ -249,9 +249,10 @@
<script>
$
(
function
()
{
$
(
'
#datatable
'
).
datatable
();
$
(
'
#datatable
'
).
datatable
(
{
fixedHeaderOffset
:
41
}
);
$
(
'
#dtFromData
'
).
datatable
({
fixedHeaderOffset
:
41
,
data
:
{
cols
:
...
...
src/js/datatable.js
浏览文件 @
263a7ec2
...
...
@@ -34,6 +34,7 @@
DataTable
.
DEFAULTS
=
{
fixedHeader
:
true
,
// fixedHeaderOffset: 41, // set top offset of header when fixed
checkable
:
true
,
checkByClickRow
:
true
,
checkSingleByClickRow
:
true
,
...
...
@@ -235,8 +236,12 @@
row
=
rows
[
r
];
cssClass
=
row
.
cssClass
||
''
;
if
(
row
.
checked
)
cssClass
+=
'
'
+
(
options
.
checkedClass
||
''
);
if
(
typeof
row
.
id
===
'
undefined
'
)
{
row
.
id
=
r
;
}
tr
=
'
<tr class="
'
+
cssClass
+
'
" data-index="
'
+
r
+
'
" data-id="
'
+
(
row
.
id
||
r
)
+
'
">
'
;
tr
=
'
<tr class="
'
+
cssClass
+
'
" data-index="
'
+
r
+
'
" data-id="
'
+
row
.
id
+
'
">
'
;
leftHtml
+=
tr
;
rightHtml
+=
tr
;
flexHtml
+=
tr
;
...
...
@@ -309,6 +314,7 @@
// bind events
var
options
=
this
.
options
,
self
=
this
,
data
=
this
.
data
,
$cells
=
this
.
$cells
,
$dataCells
=
this
.
$dataCells
,
$headCells
=
this
.
$headCells
,
...
...
@@ -430,7 +436,8 @@
if
(
options
.
checkable
)
{
var
checkedStatusStoreName
=
self
.
id
+
'
_
'
+
checkedStatus
,
checkedClass
=
options
.
checkedClass
;
checkedClass
=
options
.
checkedClass
,
rowId
;
var
syncChecks
=
function
()
{
var
$rows
=
self
.
$rowsSpans
.
first
().
find
(
'
.table > tbody > tr
'
);
...
...
@@ -438,8 +445,16 @@
var
checkedStatus
=
{
checkedAll
:
$rows
.
length
===
$checkedRows
.
length
&&
$checkedRows
.
length
>
0
,
checks
:
$checkedRows
.
map
(
function
(){
return
$
(
this
).
data
(
'
id
'
)}).
toArray
()
checks
:
$checkedRows
.
map
(
function
()
{
rowId
=
$
(
this
).
data
(
'
id
'
);
return
rowId
;
}).
toArray
()
};
$
.
each
(
data
.
rows
,
function
(
index
,
value
)
{
value
.
checked
=
(
$
.
inArray
(
value
.
id
,
checkedStatus
.
checks
)
>
-
1
);
});
self
.
$headSpans
.
find
(
'
.check-all
'
).
toggleClass
(
'
checked
'
,
checkedStatus
.
checkedAll
);
store
.
pageSet
(
checkedStatusStoreName
,
checkedStatus
);
...
...
@@ -483,10 +498,9 @@
height
,
scrollTop
,
$dataTableHead
=
$datatable
.
children
(
'
.datatable-head
'
),
navbarHeight
=
$
(
'
.navbar.navbar-fixed-top
'
).
height
()
||
0
;
navbarHeight
=
options
.
fixedHeaderOffset
||
$
(
'
.navbar.navbar-fixed-top
'
).
height
()
||
0
;
var
handleScroll
=
function
()
{
console
.
log
(
navbarHeight
);
scrollTop
=
$
(
window
).
scrollTop
();
offsetTop
=
$datatable
.
offset
().
top
;
height
=
$datatable
.
height
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录