Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
易企天创
zui
提交
c1997eb7
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,发现更多精彩内容 >>
提交
c1997eb7
编写于
8月 11, 2014
作者:
C
Catouse
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
* fixed errors in datatable.
* updated document.
上级
c3e47472
变更
5
展开全部
隐藏空白更改
内联
并排
Showing
5 changed file
with
48 addition
and
30 deletion
+48
-30
dist/js/zui.js
dist/js/zui.js
+18
-9
dist/js/zui.min.js
dist/js/zui.min.js
+2
-2
docs/example/datatable.html
docs/example/datatable.html
+9
-9
docs/js/doc.js
docs/js/doc.js
+1
-1
src/js/datatable.js
src/js/datatable.js
+18
-9
未找到文件。
dist/js/zui.js
浏览文件 @
c1997eb7
...
...
@@ -4597,11 +4597,11 @@ var imgReady = (function () {
rowCol
=
row
.
data
[
i
];
if
(
!
$
.
isPlainObject
(
rowCol
))
{
rowCol
=
{
text
:
rowCol
};
rowCol
=
{
text
:
rowCol
,
row
:
r
,
index
:
i
};
row
.
data
[
i
]
=
rowCol
;
}
td
=
'
<td data-index="
'
+
i
+
'
" data-flex="false" data-type="
'
+
cols
[
i
].
type
+
'
" class="
'
+
(
rowCol
.
cssClass
||
''
)
+
'
'
+
(
cols
[
i
].
colClass
||
''
)
+
'
" style="
'
+
(
rowCol
.
css
||
''
)
+
'
">
'
+
rowCol
.
text
+
'
</td>
'
;
td
=
'
<td data-
row="
'
+
r
+
'
" data-
index="
'
+
i
+
'
" data-flex="false" data-type="
'
+
cols
[
i
].
type
+
'
" class="
'
+
(
rowCol
.
cssClass
||
''
)
+
'
'
+
(
cols
[
i
].
colClass
||
''
)
+
'
" style="
'
+
(
rowCol
.
css
||
''
)
+
'
">
'
+
rowCol
.
text
+
'
</td>
'
;
if
(
i
==
0
&&
options
.
checkable
)
{
td
=
'
<td data-index="check" class="check-row check-btn"><i class="icon-check-empty"></i></td>
'
+
td
;
...
...
@@ -4847,10 +4847,10 @@ var imgReady = (function () {
navbarHeight
=
options
.
fixedHeaderOffset
||
$
(
'
.navbar.navbar-fixed-top
'
).
height
()
||
0
;
var
handleScroll
=
function
()
{
scrollTop
=
$
(
window
).
scrollTop
();
offsetTop
=
$datatable
.
offset
().
top
;
scrollTop
=
$
(
window
).
scrollTop
();
height
=
$datatable
.
height
();
$datatable
.
toggleClass
(
'
head-fixed
'
,
scrollTop
>
offsetTop
&&
scrollTop
<
(
offsetTop
+
height
));
$datatable
.
toggleClass
(
'
head-fixed
'
,
(
scrollTop
+
navbarHeight
)
>
offsetTop
&&
(
scrollTop
+
navbarHeight
)
<
(
offsetTop
+
height
));
if
(
$datatable
.
hasClass
(
'
head-fixed
'
))
{
$dataTableHead
.
css
(
...
...
@@ -4869,6 +4869,7 @@ var imgReady = (function () {
handleScroll
();
}
// make sortable
if
(
options
.
sortable
)
{
var
$th
,
sortdown
;
...
...
@@ -4878,6 +4879,8 @@ var imgReady = (function () {
});
}
//
this
.
refresh
();
};
...
...
@@ -4933,11 +4936,13 @@ var imgReady = (function () {
}
});
var
valA
,
valB
,
result
;
var
valA
,
valB
,
result
,
$dataRows
=
this
.
$dataCells
.
filter
(
'
[data-index="
'
+
index
+
'
"]
'
)
;
rows
.
sort
(
function
(
cellA
,
cellB
)
{
valA
=
cellA
.
data
[
index
].
text
;
valB
=
cellB
.
data
[
index
].
text
;
cellA
=
cellA
.
data
[
index
];
cellB
=
cellB
.
data
[
index
];
valA
=
$dataRows
.
filter
(
'
[data-row="
'
+
cellA
.
row
+
'
"]
'
).
text
();
valB
=
$dataRows
.
filter
(
'
[data-row="
'
+
cellB
.
row
+
'
"]
'
).
text
();
if
(
type
===
'
number
'
)
{
valA
=
parseFloat
(
valA
);
...
...
@@ -4979,9 +4984,9 @@ var imgReady = (function () {
// save sort with local storage
store
.
pageSet
(
sorterStoreName
,
{
index
:
index
,
type
:
sortUp
?
'
up
'
:
'
down
'
});
}
}
;
DataTable
.
prototype
.
refresh
=
function
()
DataTable
.
prototype
.
refresh
Size
=
function
()
{
var
$datatable
=
this
.
$datatable
,
options
=
this
.
options
,
...
...
@@ -4995,7 +5000,11 @@ var imgReady = (function () {
{
$cells
.
filter
(
'
[data-index="
'
+
i
+
'
"]
'
).
css
(
'
width
'
,
cols
[
i
].
width
);
}
};
DataTable
.
prototype
.
refresh
=
function
()
{
this
.
refreshSize
();
this
.
sortTable
();
}
...
...
dist/js/zui.min.js
浏览文件 @
c1997eb7
此差异已折叠。
点击以展开。
docs/example/datatable.html
浏览文件 @
c1997eb7
...
...
@@ -257,7 +257,7 @@ $(function()
{
cols
:
[
{
sort
:
'
up
'
,
width
:
80
,
text
:
'
#
'
,
type
:
'
number
'
,
flex
:
false
,
colClass
:
'
text-center
'
,
css
:
'
color: #444
'
},
{
sort
:
'
down
'
,
width
:
80
,
text
:
'
#
'
,
type
:
'
number
'
,
flex
:
false
,
colClass
:
'
text-center
'
,
css
:
'
color: #444
'
},
{
width
:
'
auto
'
,
text
:
'
Name
'
,
type
:
'
string
'
,
flex
:
false
},
{
width
:
100
,
text
:
'
Mood
'
,
type
:
'
string
'
,
flex
:
false
},
{
width
:
150
,
text
:
'
Date
'
,
type
:
'
date
'
,
flex
:
true
,
cssClass
:
'
text-center
'
},
...
...
@@ -267,14 +267,14 @@ $(function()
],
rows
:
[
{
checked
:
false
,
data
:
[
'
1
'
,
'
Catouse
'
,
'
happy
'
,
'
2014-08-07
'
,
'
null is good
'
,
'
1
'
,
'
OK
'
]},
{
checked
:
true
,
data
:
[
'
2
'
,
'
Shine
'
,
'
angry
'
,
'
2014-08-06
'
,
'
god is girl
'
,
'
2
'
,
'
OK
'
]},
{
checked
:
false
,
data
:
[
'
3
'
,
'
Minus
'
,
'
Veritatis
'
,
'
2014-08-07
'
,
'
Nulla
'
,
'
1
'
,
'
Ipsam
'
]},
{
cssClass
:
'
danger
'
,
checked
:
false
,
data
:
[
'
4
'
,
'
Consequatur
'
,
'
Accusamus
'
,
'
2014-08-07
'
,
'
Obcaecati
'
,
'
1
'
,
'
Qui
'
]},
{
checked
:
false
,
data
:
[
'
5
'
,
'
Lorem
'
,
'
Quos
'
,
'
2014-08-07
'
,
'
Molestiae
'
,
'
1
'
,
'
Qui
'
]},
{
checked
:
false
,
data
:
[
'
6
'
,
'
Suscipit
'
,
'
Vitae
'
,
'
2014-08-07
'
,
'
Suscipit
'
,
'
1
'
,
'
AE
'
]},
{
checked
:
false
,
data
:
[
'
7
'
,
'
Vel
'
,
'
Blanditiis
'
,
'
2014-08-07
'
,
'
Aspernatur
'
,
'
1
'
,
'
Sed
'
]},
{
checked
:
false
,
data
:
[
'
8
'
,
'
Vero
'
,
'
Officiis
'
,
'
2014-08-07
'
,
'
Quos
'
,
'
1
'
,
'
Vel
'
]}
{
checked
:
false
,
data
:
[
'
1
'
,
'
<a href="###">Catouse</a>
'
,
'
happy
'
,
'
2014-08-07
'
,
'
null is good
'
,
'
1
'
,
'
OK
'
]},
{
checked
:
true
,
data
:
[
'
2
'
,
'
<a data="fd" href="###">Shine</a>
'
,
'
angry
'
,
'
2014-08-06
'
,
'
god is girl
'
,
'
2
'
,
'
OK
'
]},
{
checked
:
false
,
data
:
[
'
3
'
,
'
<a href="###">Minus</a>
'
,
'
Veritatis
'
,
'
2014-08-07
'
,
'
Nulla
'
,
'
1
'
,
'
Ipsam
'
]},
{
cssClass
:
'
danger
'
,
checked
:
false
,
data
:
[
'
4
'
,
'
<a href="###">Consequatur</a>
'
,
'
Accusamus
'
,
'
2014-08-07
'
,
'
Obcaecati
'
,
'
1
'
,
'
Qui
'
]},
{
checked
:
false
,
data
:
[
'
5
'
,
'
<a href="###">Lorem</a>
'
,
'
Quos
'
,
'
2014-08-07
'
,
'
Molestiae
'
,
'
1
'
,
'
Qui
'
]},
{
checked
:
false
,
data
:
[
'
6
'
,
'
<a href="###">Suscipit</a>
'
,
'
Vitae
'
,
'
2014-08-07
'
,
'
Suscipit
'
,
'
1
'
,
'
AE
'
]},
{
checked
:
false
,
data
:
[
'
7
'
,
'
<a href="###">Vel</a>
'
,
'
Blanditiis
'
,
'
2014-08-07
'
,
'
Aspernatur
'
,
'
1
'
,
'
Sed
'
]},
{
checked
:
false
,
data
:
[
'
8
'
,
'
<a href="###">Vero</a>
'
,
'
Officiis
'
,
'
2014-08-07
'
,
'
Quos
'
,
'
1
'
,
'
Vel
'
]}
]
}
});
...
...
docs/js/doc.js
浏览文件 @
c1997eb7
...
...
@@ -95,7 +95,7 @@ $(function()
var
ver
=
$this
.
data
(
'
version
'
)
+
''
;
if
(
versionToNumber
(
ver
)
>
versionNum
)
{
$this
.
children
(
'
.page-header
'
).
children
(
'
h2
'
).
append
(
'
<small class="label label-warning" title="" data-original-title="此内容正在开发中">DEV</small>
'
);
$this
.
children
(
'
.page-header
'
).
children
(
'
h2
'
).
append
(
'
<small class="label label-warning" title="" data-original-title="此内容正在开发中
,将在v
'
+
ver
+
'
中提供
">DEV</small>
'
);
}
});
...
...
src/js/datatable.js
浏览文件 @
c1997eb7
...
...
@@ -283,11 +283,11 @@
rowCol
=
row
.
data
[
i
];
if
(
!
$
.
isPlainObject
(
rowCol
))
{
rowCol
=
{
text
:
rowCol
};
rowCol
=
{
text
:
rowCol
,
row
:
r
,
index
:
i
};
row
.
data
[
i
]
=
rowCol
;
}
td
=
'
<td data-index="
'
+
i
+
'
" data-flex="false" data-type="
'
+
cols
[
i
].
type
+
'
" class="
'
+
(
rowCol
.
cssClass
||
''
)
+
'
'
+
(
cols
[
i
].
colClass
||
''
)
+
'
" style="
'
+
(
rowCol
.
css
||
''
)
+
'
">
'
+
rowCol
.
text
+
'
</td>
'
;
td
=
'
<td data-
row="
'
+
r
+
'
" data-
index="
'
+
i
+
'
" data-flex="false" data-type="
'
+
cols
[
i
].
type
+
'
" class="
'
+
(
rowCol
.
cssClass
||
''
)
+
'
'
+
(
cols
[
i
].
colClass
||
''
)
+
'
" style="
'
+
(
rowCol
.
css
||
''
)
+
'
">
'
+
rowCol
.
text
+
'
</td>
'
;
if
(
i
==
0
&&
options
.
checkable
)
{
td
=
'
<td data-index="check" class="check-row check-btn"><i class="icon-check-empty"></i></td>
'
+
td
;
...
...
@@ -533,10 +533,10 @@
navbarHeight
=
options
.
fixedHeaderOffset
||
$
(
'
.navbar.navbar-fixed-top
'
).
height
()
||
0
;
var
handleScroll
=
function
()
{
scrollTop
=
$
(
window
).
scrollTop
();
offsetTop
=
$datatable
.
offset
().
top
;
scrollTop
=
$
(
window
).
scrollTop
();
height
=
$datatable
.
height
();
$datatable
.
toggleClass
(
'
head-fixed
'
,
scrollTop
>
offsetTop
&&
scrollTop
<
(
offsetTop
+
height
));
$datatable
.
toggleClass
(
'
head-fixed
'
,
(
scrollTop
+
navbarHeight
)
>
offsetTop
&&
(
scrollTop
+
navbarHeight
)
<
(
offsetTop
+
height
));
if
(
$datatable
.
hasClass
(
'
head-fixed
'
))
{
$dataTableHead
.
css
(
...
...
@@ -555,6 +555,7 @@
handleScroll
();
}
// make sortable
if
(
options
.
sortable
)
{
var
$th
,
sortdown
;
...
...
@@ -564,6 +565,8 @@
});
}
//
this
.
refresh
();
};
...
...
@@ -619,11 +622,13 @@
}
});
var
valA
,
valB
,
result
;
var
valA
,
valB
,
result
,
$dataRows
=
this
.
$dataCells
.
filter
(
'
[data-index="
'
+
index
+
'
"]
'
)
;
rows
.
sort
(
function
(
cellA
,
cellB
)
{
valA
=
cellA
.
data
[
index
].
text
;
valB
=
cellB
.
data
[
index
].
text
;
cellA
=
cellA
.
data
[
index
];
cellB
=
cellB
.
data
[
index
];
valA
=
$dataRows
.
filter
(
'
[data-row="
'
+
cellA
.
row
+
'
"]
'
).
text
();
valB
=
$dataRows
.
filter
(
'
[data-row="
'
+
cellB
.
row
+
'
"]
'
).
text
();
if
(
type
===
'
number
'
)
{
valA
=
parseFloat
(
valA
);
...
...
@@ -665,9 +670,9 @@
// save sort with local storage
store
.
pageSet
(
sorterStoreName
,
{
index
:
index
,
type
:
sortUp
?
'
up
'
:
'
down
'
});
}
}
;
DataTable
.
prototype
.
refresh
=
function
()
DataTable
.
prototype
.
refresh
Size
=
function
()
{
var
$datatable
=
this
.
$datatable
,
options
=
this
.
options
,
...
...
@@ -681,7 +686,11 @@
{
$cells
.
filter
(
'
[data-index="
'
+
i
+
'
"]
'
).
css
(
'
width
'
,
cols
[
i
].
width
);
}
};
DataTable
.
prototype
.
refresh
=
function
()
{
this
.
refreshSize
();
this
.
sortTable
();
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录