Skip to content

Commit

Permalink
new column option
Browse files Browse the repository at this point in the history
  • Loading branch information
rickyleung committed Dec 4, 2017
1 parent 3545ff9 commit 4d0213b
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 12 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
## 1.6.4 (Dec 4, 2017)
* Table: new column option `customClass`.

## 1.6.3 (Nov 10, 2017)
* Dialog: new option `canClose`.

## 1.6.2 (Aug 30, 2017)
* Update homepage.

## 1.6.1 (July 19, 2017)
* Update Table demo.

Expand Down
12 changes: 9 additions & 3 deletions dist/jquery.bizui.js
Original file line number Diff line number Diff line change
Expand Up @@ -12925,7 +12925,8 @@
}
var td = $('<td></td>').attr({
align: col.align,
width: col.width
width: col.width,
class: col.customClass
});
if (col.editable && col.content.length === 1) {
td.attr('editable', '');
Expand Down Expand Up @@ -12955,7 +12956,11 @@
if (typeof _col.visible !== 'undefined' && !_col.visible || _col.content.length === 1) {
continue;
}
var _td = $('<td></td>').attr('align', _col.align), _content = _col.content[m].apply(this, [
var _td = $('<td></td>').attr({
align: _col.align,
class: _col.customClass
});
var _content = _col.content[m].apply(this, [
item,
index,
_col.field
Expand Down Expand Up @@ -12983,7 +12988,8 @@
}
var td = $('<td></td>').attr({
align: col.align,
width: col.width
width: col.width,
class: col.customClass
});
if (options.flexible) {
td.removeAttr('width');
Expand Down
2 changes: 1 addition & 1 deletion dist/jquery.bizui.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<a href="#" class="active">BizUI</a>
<a href="pages/tutorial.html">起步</a>
<a href="pages/components.html">组件</a>
<a class="github" href="https://github.com/bizdevfe/biz-ui/releases" target="_blank">GitHub&nbsp;&nbsp;v1.6.3</a>
<a class="github" href="https://github.com/bizdevfe/biz-ui/releases" target="_blank">GitHub&nbsp;&nbsp;v1.6.4</a>
</nav>

<div class="container">
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "biz-ui",
"version": "1.6.3",
"version": "1.6.4",
"description": "A jQuery plugin for business UI components",
"author": "BizFE",
"main": "dist/jquery.bizui.js",
Expand Down
2 changes: 1 addition & 1 deletion pages/components.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<a href="../index.html">BizUI</a>
<a href="tutorial.html">起步</a>
<a href="#" class="active">组件</a>
<a class="github" href="https://github.com/bizdevfe/biz-ui/releases" target="_blank">GitHub&nbsp;&nbsp;v1.6.3</a>
<a class="github" href="https://github.com/bizdevfe/biz-ui/releases" target="_blank">GitHub&nbsp;&nbsp;v1.6.4</a>
</nav>

<div class="container components">
Expand Down
4 changes: 4 additions & 0 deletions pages/src/components/Table/table.html
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,10 @@ <h4>Options</h4>
<td>[column.visible]<td>Boolean</td>
<td>此列可见,默认 true</td>
</tr>
<tr>
<td>[column.customClass]<td>String</td>
<td>自定义 class</td>
</tr>
<tr>
<td>data</td>
<td>Array</td>
Expand Down
2 changes: 1 addition & 1 deletion pages/tutorial.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<a href="../index.html">BizUI</a>
<a href="#" class="active">起步</a>
<a href="components.html">组件</a>
<a class="github" href="https://github.com/bizdevfe/biz-ui/releases" target="_blank">GitHub&nbsp;&nbsp;v1.6.3</a>
<a class="github" href="https://github.com/bizdevfe/biz-ui/releases" target="_blank">GitHub&nbsp;&nbsp;v1.6.4</a>
</nav>

<div class="container">
Expand Down
14 changes: 10 additions & 4 deletions src/ui/Table.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ require('../deps/jquery.editabletable');
* @param {Boolean} [options.column.sortable] 此列排序, 默认 false
* @param {String} [options.column.currentSort] 排序方式(des-降序 | asc-升序),仅 sortable 为 true 时生效
* @param {Boolean} [options.column.visible] 此列可见,默认 true
* @param {Boolean} [options.column.customClass] 自定义 class
* @param {Array} options.data 数据,data[i].disabledSelect = true 时此行不可选中,默认 false
* @param {String} [options.customClass] 自定义 class
* @param {String} [options.foot] 总计行位置(top | bottom),默认无总计行
Expand Down Expand Up @@ -266,7 +267,8 @@ Table.prototype = {

var td = $('<td></td>').attr({
align: col.align,
width: col.width
width: col.width,
class: col.customClass
});
if (col.editable && col.content.length === 1) {
td.attr('editable', '');
Expand Down Expand Up @@ -299,8 +301,11 @@ Table.prototype = {
continue;
}

var _td = $('<td></td>').attr('align', _col.align),
_content = _col.content[m].apply(this, [item, index, _col.field]).toString();
var _td = $('<td></td>').attr({
align: _col.align,
class: _col.customClass
});
var _content = _col.content[m].apply(this, [item, index, _col.field]).toString();
_td.html((_col.escapeContent === false) ? _content : escapeHTML(_content)).appendTo(_tr);

if (options.flexible) {
Expand Down Expand Up @@ -339,7 +344,8 @@ Table.prototype = {

var td = $('<td></td>').attr({
align: col.align,
width: col.width
width: col.width,
class: col.customClass
});

if (options.flexible) {
Expand Down

0 comments on commit 4d0213b

Please sign in to comment.